<% 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 = "

" & hResult & "


" ElseIf Request.QueryString("Action") = "Cancel" Then hResult = "Upload was cancelled." End If '{b}get an unique upload ID for this upload script and progress bar. Dim UploadID, PostURL UploadID = Form.NewUploadID HTML = HTML & hResult HTML = HTML & "Limit:" & Form.SizeLimit/1024/1024 & "Mb.
" HTML = HTML & "
" HTML = HTML & "
" HTML = HTML & "
File 1 : 
" HTML = HTML & "
" HTML = HTML & "<"+"Script>var nfiles = 1;" HTML = HTML & "function Expand(){" HTML = HTML & "nfiles++;" HTML = HTML & "files.insertAdjacentHTML('BeforeEnd','
File '+nfiles+' : ');" HTML = HTML & "};" HTML = HTML & "function loaditnow(){loadXML('xml.asp?UploadID=" & UploadID & "')}" & vbcrlf & "" HTML = HTML & "" do_Upload = HTML End Function Sub GetMainFooter %>
<% End Sub Sub GetMainHeader %> Upload
<% End Sub %>