How to use ASPUpload?

ASPUpload is a COM+ component, which enables an ASP application to capture, save and process the files uploaded to server via web browser. The files are selected for uploading via an HTML POST form using the <input type="file" /> tag.

With ASPUpload, you can add file upload functionality to your web application in as little as 2 lines of ASP script. In addition to uploading, ASPUpload offers a wide range of file management functions, including secure downloading, saving files in the database, permissions and attribute management, image size extraction, file encryption, etc.

In the below sample form, ENCTYPE="multipart/form-data attribute will instruct the browsers to send the entire file to the server. Your form must have this attribute otherwise no uploading can be performed.

The form contains three <INPUT TYPE="FILE"> which will appear as upload functionality with Browse button next to them. Each box can be used to select one file only.

The SIZE attribute of <INPUT TYPE="FILE"> is optional, whereas the NAME attribute is mandatory. This form will invoke the upload script at upload-page.asp page as shown below.


<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="upload-page.asp">

The first line of the following ASP script will simply create an instance of the ASPUpload object. The second line will call the Save method of the component which will perform the upload.

It will parse the information posted via web browser, determine the number of files is being uploaded, and save it to the specified server directory (C:\HostingSpaces\userid\\wwwroot\images) under their original names.

Then after Save method will return the number of successful file uploads, and throw an exception on error occurrence.

ASP Code

<BODY> <%
Set Upload = Server.CreateObject("Persits.Upload")
'Capture and save uploaded image
Upload.IgnoreNoPost = True
Upload.OverwriteFiles = False
Upload.Save "C:\HostingSpaces\userid\\wwwroot\images"

For further information on setting up the ASPUpload component, you can refer to ASPUpload manual page.

Note: We don't offer the ASPUpload components on our Windows Shared Hosting customers. Windows VPS users can purchase the license of ASPUpload and install it on VPS.

Related Articles

How to use Dundas Chart?

How to create a Basic Pie Chart with Dundas Chart To use this control in a web site, you will...

How to use ASPSMS?

Here is the ASP VB-Script example, intended to be used on an IIS (Internet Information Server)...

How to use ASP Email?

ASPEmail 5.0 is an active server component for sending e-mail messages using an external SMTP...

FormMail script for Windows 2008 / 2012 customers

We don't offer Windows 2008 and 2012 Shared Hosting but we offer Windows Server 2016 with Plesk...

MySQL ODBC driver on Windows 2008 / 2012 server

We don't offer Windows 2008 and 2012 Shared hosting servers anymore. We have installed the latest...

  • 136 Users Found This Useful

Was this answer helpful?