Bullschmidt.com
Home
Web Database Concept
How We Work Together
Bio
Web Database Sample
Classic ASP Design Tips
Bar Chart Tool
Web Design Resources
Access Database Sample
Classic ASP Design Tips
File Upload
These are opinions of J. Paul Schmidt, MBA.
No warranties are either expressed or implied.
To Use Paul's Services:
Paul@Bullschmidt.com
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.
And perhaps ask a shared-server Web host to allow file uploads of more than the default (sometimes 200KB) or for a dedicated server:
1) In the Remote Desktop make it so can edit the IIS metabase while IIS is still running:
Remote Desktop | Manage Your Server | Manage This Application Server | Application Server | Internet Information Services (IIS) Manager | Local Disk (local computer) | Right-click | Properties | Internet Information Services tab | Enable Direct Metabase Edit, Allows you to edit the IIS metabase configuration file while IIS is still running changed from unchecked to checked
2) In the Remote Desktop edit the IIS metabase very carefully backing it up first so that can upload files larger than 200KB (set for 100MB although don't know if really could ever upload a file that large):
Remote Desktop | My Computer | Local Disk (C:) | Windows | System32 | Inetsrv | Metabase.xml | Edit | Copy | Edit | Paste | Rename Copy of Metabase.xml to be zzJPS Copy of Metabase.xml | Highlight the original Metabase.xml | Right-click and Edit (which opens in Notepad or can do Open With Notepad, but apparently changes do not get saved if instead do Open With WordPad | Edit | Find AspMaxRequestEntityAllowed | Change AspMaxRequestEntityAllowed="204800" to instead be AspMaxRequestEntityAllowed="104857600"
And whatever file uploading solution you use, on the page in question you will no longer be able to refer to regular form fields with Request.Form("MyField"). Instead there will be some kind of proprietary way to refer to the fields.
Here is a resource for letting the user upload one or more files which is something that was unfortunately not built into ASP:
Pure ASP File Upload by Jacob Gilley
http://www.asp101.com/articles/jacob/scriptupload.asp
Free ASP Upload
http://www.freeaspupload.net
ASP Upload Class by Adrian Forbes
http://www.aspfree.com/c/a/ASP/ASP-Upload-Class
To Use Paul's Services:
Paul@Bullschmidt.com
Copyright © 2000-2010
J. Paul Schmidt, MBA
Freelance Web and Database Developer
All Rights Reserved
Privacy Policy