WebFileUploader.UploadComplete

From Real Software Documentation

Jump to: navigation, search
Event

WebFileUploader.UploadComplete ( Files() as WebUploadedFile )

UploadComplete is called when the the browser has finished uploading the files to the server.

At this point the files only exist in memory. You need to process the Files() array to save the actual files to disk or to a database.


Example

This example will process all the files that were uploaded and save only the pictures to the UploadFolder on the server.

Dim source As Picture
Dim pictureFile As FolderItem

Dim uploadFolder As FolderItem
uploadFolder = GetFolderItem("UploadFolder")

If Not uploadFolder.Exists Then
uploadFolder.CreateAsFolder
End If

For Each file As WebUploadedFile In Files
Try
source = Picture.FromData(file.Data)

// Create a file on the server
pictureFile = uploadFolder.Child(file.Name)

source.Save(pictureFile, Picture.SaveAsPNG)

Catch e As UnsupportedFormatException
Continue // Skip this file
End Try
Next
Personal tools