From Xojo Documentation
|You are currently browsing the old Xojo documentation site. It will go offline as of October 2, 2023. Please visit the new Xojo documentation site! - you will be redirected shortly...|
If the temporary folder is writable, the File property will point to the temporary file and the Save method will allow you to save the file elsewhere. You can also use the Data property to load the file into memory.
Any temporary files that are created by the upload process are deleted when the WebFileUploader.UploadFinished event handler returns.
If the temporary folder is not writable, the files are kept in memory and accessed using the Data property.
This code in WebFileUploader.UploadFinished will process all the files that were uploaded and save only the pictures to the UploadFolder on the server.
Var pictureFile As FolderItem
Var uploadFolder As FolderItem
uploadFolder = New FolderItem("UploadFolder")
If Not uploadFolder.Exists Then
For Each file As WebUploadedFile In Files
source = Picture.FromData(file.Data)
// Create a file on the server
pictureFile = uploadFolder.Child(file.Name)
Catch e As UnsupportedFormatException
Continue // Skip this file