UploadedFile Object (Dundas Upload Control 2.0)

Dundas

UploadedFile Object (Dundas Upload Control 2.0)

Comprises the Files collection, and stores data for one uploaded file.

Remarks

The UploadedFile object is used to store information and data about an uploaded file, and each object corresponds to a file uploaded via an html form.

You must first call the control's Save or SaveToMemory method before attempting to use the Files collection. See the sample code below for an illustration of this.

If you call the SaveToMemory method then the Path property will be a zero-length string.

Example

'this sample code illustrates how to populate the Files collection ' with UploadedFile objects

'method failures usually throw an exception

On Error Resume Next

'create an instance of the Upload Control
Set
objUpload = Server.CreateObject("Dundas.Upload.2")
'we will examine the Err object to see if an error occurred, if so we will

' redirect user to an error page

If
Err.Number <> 0 Then
Response.Redirect "Error.asp?Error=" & Err.Description
End If

'call the SaveToMemory method of the control to populate the Files collection first
objUpload.SaveToMemory

'loop through all uploaded files, and output their size in bytes
For
Each objUploadedFile in objUpload.Files
Response.Write("Size: " & objUploadedFile.Size & "<br>")
Next

'destroy Upload object
Set
objUpload = Nothing