%
Option Explicit
Dim Action: Action = "UPLOAD"
Dim CurrentFolder
Dim CurrentPath
'Top header, styles.
GetMainHeader
Response.write do_Upload (CurrentFolder)
GetMainFooter
%><%
'************************ do_Upload
'Accepts uploads and returns upload form.
Function do_Upload(rel_Folder)
Server.ScriptTimeout = 3600
'Create upload form
'Using Pure-ASP file upload
Dim Form: Set Form = New ASPForm
'{b}Set the upload ID for this form.
'Progress bar window will receive the same ID.
Form.UploadID = Request.QueryString("UploadID")'{/b}
Form.SizeLimit = 1000 * 1024 * 1024 '10MB
Dim HTML, hResult
Const fsCompletted = 0
Const fsSizeLimit = &HD
Const fsTimeOut = &HE
Const fsError = &HA
If Form.State > fsError Then 'Some error state.
If Form.State = fsSizeLimit Then 'Data size exceeds limit.
hResult = "Upload size (" & Round((Request.TotalBytes/1024),0) & "kB) exceeds limit (" & Form.SizeLimit/1024 & "kB)."
ElseIf Form.State = fsTimeOut Then 'Request timeout
hResult = "Upload time exceeds limit (" & Form.ReadTimeout & "s)."
Else
hResult = "Another upload problem (code " & Form.State & ")"
End If
hResult = "" & hResult & "
"
Response.Status = "400 Bad request"
ElseIf Form.State = fsCompletted Then 'Completted
Form.Files.Save MapFolderToDisk(rel_Folder)
hResult = "File(s) saved to folder. Thank you"
hResult = "