First let's deal with the timeout issue which can be a problem if a user is uploading a fairly large file (although perhaps you don't want the timeout increased too much because you DON'T want a user uploading a large file).
For pure ASP (i.e. non component) solutions (and I believe this would be true for component solutions too) can increase the timeout for the page:
' Script timeout in seconds for this page.
' (60 x 60 = 1 hour.)
Server.ScriptTimeout = 60 * 60
Also the Anonymous Internet user needs Change permission on the folder that a file is going to be uploaded to and actually Full Access might be better if you are later going to use the FileSystemObject to delete a file.
Here are some resources for letting the user upload a file which is something that was unfortunately not built into ASP:
ASP File Upload Using VBScript by John R. Lewis - 7/10/2000
http://www.aspzone.com/articles/john/aspUpload
Does NOT use a component.
The clsUpload class uses these other classes: clsCollection, clsFile
Seems to allow for the possibility that a post came in whose form did not have enctype="multipart/form-data" although this doesn't seem to be an issue to me.
There is an internal URLDecode() function in case form submitted with no ENCTYPE="multipart/form-data" in the form tag.
Doesn't have a FileSize property although this can be added.
Assumes the filename will stay the same although it is not hard to slightly modify the class to change this.
UltraFastAspUpload by Cakkie (http://home.planetinternet.be/~aerts1) - 1/3/2002
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=7093&lngWId=4
<<
This page will handle file uploads much faster than other ASP pages. Indeed, this is a 100% ASP solution, so no need to register any additional components. The major speed-gain is caused by the conversion from binary to ANSI. Other codes use a loop and the Chr(AscB(MidB(...))), which is awfully slow. Doing that with a 1 MB file would result in doing a For T = 1 To 1000000. When handling a file, the old code took 25 seconds to process the file. My code needed 2 seconds, need to say more?
>>
Does NOT use a component.
Not a class.
No ContentType.
Assumes the filename will stay the same although it is perhaps not hard to slightly modify the code to change this.
Can't access non-file fields from form.
Cakkie's Web site is not in English.
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.