ASP Uploader in action: selecting multiple files for upload

Selecting multiple files for upload with ASP Uploader

Prefer to see it in action? The live demo lets you try multiple file selection right in your browser.

Try the live demo

What the recording shows

It runs through one complete upload, which is four distinct stages. Each one is worth naming, because each is a place where a plain <input type="file"> gives the user nothing:

  1. Selection. One dialog, several files. The user ctrl-clicks or shift-clicks a group in the file dialog. A standard file input takes one file per control, so a five-file upload means five controls and five trips through the dialog.
  2. The queue. Each file becomes its own row with its own status. Files can be added while earlier ones are still transferring, and any single file can be removed without disturbing the rest.
  3. Transfer. The progress bar reports bytes actually sent, plus an estimate of the time remaining. Classic ASP cannot produce this by itself — the page does not begin executing until the upload has already finished, which is why progress reporting has to come from the browser.
  4. Completion. Each finished file fires a client-side event, so the page can update itself — a thumbnail, an attachment row, an enabled submit button — with no reload.

The code behind it

The whole page in the recording is this:

<%@ Language="VBScript" %>
<!-- #include file="aspuploader/include_aspuploader.asp" -->

<form id="form1" method="POST">
    <%
    Dim uploader
    Set uploader = new AspUploader
    uploader.Name = "myuploader"
    uploader.MultipleFilesUpload = true
    uploader.MaxSizeKB = 10240
    uploader.InsertText = "Upload File (Max 10M)"
    uploader.AllowedFileExtensions = "*.jpg,*.png,*.gif,*.zip"
    %>
    <%= uploader.GetString() %>
</form>

There is no enctype and no file input, because the files do not travel with the form post — each one uploads on its own background request and the form receives a short list of identifiers instead. That is also why the final submit is instant rather than a second wait.

See it for real

A recording only proves so much. The demos below are running live on this server, and each one includes the complete ASP source for the page:

Download the free trial Read the guides