A lot of websites based on classic ASP already use Upload Suite to organize uploads to their sites. Let's see how you can integrate it with your site.
Integration of any uploader requires doing two things:
As for the server-side part, you can use one of the familiar third-party component such as ABCUpload, DundasUpload or Persits AspUpload. If you don't want to install a component on your server, it is possible to use even pure VBScript upload processor.
Let's see how you integrate Upload Suite with your site step by step.
Upload Suite consists of two uploaders - a lightweight uploader based on HTML5/Flash and more advanced Java/ActiveX uploader. You can use either one of them or both.
First, let's make some preparations:
The first thing you need to do is to link HTML5/Flash uploader scripts and styles with the page where you are going to use it (the ones you copied to your server as per previous section). There are two files you generally need to link:
You can do it as follows:
$au.imageUploaderFlash. To insert the uploader, you should:
It looks like this:
Here are some comments about the uploader settings:
type— specifies whether you want to use HTML5, Flash or both. Typically, the default value is fine, but you can change if you need more control.
licenseKey— you should either use a trial license key or insert a full license key received upon the purchase. You may omit it for localhost.
converters— defines whether it is necessary to do with files before the upload. In this code, uploader is configured to upload only original files.
uploadSettings.actionUrl— specifies the URL of the script where the POST request is sent. We will write this script a bit later.
uploadSettings.redirectUrl— tells the uploader what page to open when all files are successfully uploaded. Omit this param if you don't want to leave the page.
flashControl.codeBase— specifies where the Flash uploader binary is located. If you use some unusual location for the Scripts folder, don't forget to update it!
For more detailed explanation, please refer the documentation.
Inserting ActiveX/Java uploader is very similar to the HTML5/Flash counterpart. The difference is that you should link other .js files:
To embed ActiveX/Java uploader, use
$au.uploader object instead of
As you see, it is very similar to HTML5/Flash, however there are few differences:
javaControlcodebases — specify from where to download the .cab and .jar files. Make sure that these URLs are valid.
$au.installationProgressobject — connects the installation progress with the uploader. Optional.
type— likewise to HTML5/Flash, it tells whether to use ActiveX or Java part. Note, ActiveX works only in IE. If you turn it off, Java will be loaded there.
Now it is a time to write a server-side upload processing code. If you ever dealt with a regular Browse button uploader, you should familiar to it.
Let's see how to do it using the Persits component (aspupload.com).
<%@ language="VBScript" %> <% Set Upload = Server.CreateObject("Persits.Upload") Upload.CodePage = 65001 'UTF8 Upload.Save "c:\temp\persits" %>
You can create more complicated scripts - if you omit a path where to save files in the
Save method, it will save uploaded files in memory. You will be able to use
Upload.Form collection to extract files and other data sent by the uploader. Refer list of POST fields sent by Aurigma for more details.
You can find some classic ASP sample applications in the Upload Suite package. Typically, it is available here: