%
'Stores only files with size less than MaxFileSize
Dim DestinationPath
DestinationPath = Server.mapPath("UploadFolder")
'Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")
Dim Form: Set Form = New ASPForm %><%
Server.ScriptTimeout = 2000
Form.SizeLimit = &HA00000
'{b}Set the upload ID for this form.
'Progress bar window will receive the same ID.
if len(Request.QueryString("UploadID"))>0 then
Form.UploadID = Request.QueryString("UploadID")'{/b}
end if
'was the Form successfully received?
Const fsCompletted = 0
If Form.State = fsCompletted Then 'Completted
'was the Form successfully received?
if Form.State = 0 then
'Do something with upload - save, enumerate, ...
response.write "
Upload result: Files successfully received."
'response.write "
Number of file fields:" & Form.Files.Count
'response.write "
Request total bytes:" & Request.TotalBytes
Form.Files.Save DestinationPath
'response.write "
Files was saved to " & DestinationPath & " folder."
End If
ElseIf Form.State > 10 then
Const fsSizeLimit = &HD
Select case Form.State
case fsSizeLimit: response.write "
Source form size (" & Form.TotalBytes & "B) exceeds form limit (" & Form.SizeLimit & "B)
"
case else response.write "
Some form error.
"
end Select
End If'Form.State = 0 then
Subject = "Files Uploaded To Server - Working"
ToAddress = "info@printbrokersusa.com"
FromAddress = "info@printbrokersusa.com"
Dim myMail
Set myMail=Server.CreateObject("CDO.Message")
myMail.To=ToAddress
myMail.From=FromAddress
myMail.Subject=Subject
myMail.textBody=Body
myMail.Send
'{b}get an unique upload ID for this upload script and progress bar.
Dim UploadID, PostURL
UploadID = Form.NewUploadID
'Send this ID as a UploadID QueryString parameter to this script.
PostURL = Request.ServerVariables("SCRIPT_NAME") & "?UploadID=" & UploadID'{/b}
%>