%
'Option Explicit
'Stores only files with size less than MaxFileSize
Dim DestinationPath
DestinationPath = Server.mapPath("UploadFolder")
'Create upload form
'Using Huge-ASP file upload
'Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")
'Using Pure-ASP file upload
Dim Form: Set Form = New ASPForm %>
<%
Server.ScriptTimeout = 2000
Form.SizeLimit = &H100000
If Form.State = 0 Then 'Completted
Form.Files.Save DestinationPath
response.write "
Files (" & Form.TotalBytes \1024 & "kB) was saved to " & DestinationPath & " folder."
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
%>