<%
Set Upload = Server.CreateObject("Persits.Upload"
' Limit file size to 50000 bytes, throw an exception if file is larger
Upload.SetMaxSize 50000, True
' Intercept all exceptions to display user-friendly error
On Error Resume Next
' 8 is the number of "File too large" exception
If Err.Number = 8 Then
Response.Write "Your file is too large. Please try again."
Else
If Err <> 0 Then
Response.Write "An error occurred: " & Err.Description
Else
Response.Write "Success!"
End If
End If
%>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.