View Full Version : ASP Upload
robocop
07-31-2003, 11:22 PM
Hello again to you all. ive gotten the ins/outs of asp and database connectivity i think......now comes this challenge. i wanna do an upload box to where i can upload images to a folder on the server. not only that, but id like the script to write a record to the database....
i can probably figure out the uploading part of it...thats pretty simple....but how would i grab the image name from the file name and write that to a field on the DB? just wondering if there was any free scripts out there that do this too....
thanks yall!
kc
Morgoth
08-01-2003, 05:58 AM
Try:
http://www.aspin.com
Do a search, I am sure this script is areound somewhere.
Bullschmidt
08-05-2003, 05:01 AM
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 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 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
fractalvibes
08-05-2003, 04:15 PM
There are a number of good components on the market.
Check http://www.aspupload.com/
No sense reinventing the wheel your self...
Phil
robocop
08-05-2003, 04:19 PM
Cool! But what if im running through a webhost (i.e. i dont have access/rights to install components) ? will any of these work?
fractalvibes
08-05-2003, 04:24 PM
That is something you would have to work out with the web hosting folks.
www.asptoday.com had a good article on doing this purely in ASP/VBScript, but it is pretty ugly...
Phil
Bullschmidt
08-05-2003, 05:04 PM
The following which I suggested above does not require a component:
ASP File Upload Using VBScript by John R. Lewis - 7/10/2000
http://www.aspzone.com/articles/john/aspUpload
Bullschmidt
07-22-2005, 06:29 PM
Updated (corrected) link:
ASP File Upload Using VBScript by John R. Lewis - 7/10/2000
http://aspzone.com/articles/160.aspx
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.