<%@language=vbscript%> <% dim Uploader, File 'Get reference to ASPUploader: set Uploader = GetASPUploader 'ID is needed for progress bar only: Uploader.ID = Request.QueryString("ID") 'Use either physical (C:\Upload), relative (..\Upload), or virtual (/Upload) paths: Uploader.Destination = "Upload" 'Use AddFile method to add file objects and change thier properties as needed: set File = Uploader.AddFile("DocFile") File.ValidFileTypes = "txt,doc" File.MaxSize = 128 * 1024 File.Overwrite = true set File = Uploader.AddFile("AviFile") File.ValidFileTypes = "avi" File.DeleteIncomplete = false File.Destination = "Movies" 'You can change filename: File.Name = Year(Now) & "-" & Month(Now) & "-" & Day(Now) & "_" & Hour(Now) & "-" & Minute(Now) & "-" & Second(Now) & ".avi" 'Note: We added "DocFile" and "AviFile" but did not add "AnyFile" because we do not need to change its properties, although we could. 'Set longer timeout for large files if needed: Server.ScriptTimeout = 900 'Enable error handling to catch and handle errors during upload. For example, if user cancels the upload or 'attempts to upload files of invalid (unallowed) type or size, ASPUploader will raises an exception (error) 'with relevant descrition: on error resume next 'Start receiving and saving file(s): Uploader.Upload 'Check for errors: if Err then Response.Write Err.Source & ": " & Err.Description else Response.Write "Upload complete
" Response.Write "Value of Text1 field is " & Uploader.Form("Text1") end if %>