need,purchase,expensive,components,with,alrea
Quick Search for:  in language:    
need,purchase,expensive,components,with,alrea
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 144,429 lines
 Jobs: 168 postings

 
Sponsored by:

 

You are in:

 
Login


 

 


Latest Code Ticker for ASP/ VbScript.
Click here to see a screenshot of this code!Ping in ASP
By Michele_Garneri on 10/28

(Screen Shot)

Embed Real Player Object
By Ziae Mousavi m. on 10/27


Set Country --> Combobox
By Hohl David on 10/27


Client Side Sorting of records
By Ravi Rajan on 10/26


Recordset paging with images
By Ravi Rajan on 10/26


Click here to see a screenshot of this code!Online photo catalogue VBScript 2.1
By Ivan Loire on 10/26

(Screen Shot)

GPS 1.4 WYSIWYG
By Guo Xu on 10/25


Click here to see a screenshot of this code!A Network Monitor tool from ActivXperts Software Inc.
By Freddy Hofstadt on 10/25

(Screen Shot)

Socket samples based on Winsock, TCP/IP and client/server communication
By Ronny Bright on 10/25


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Upload Files Without COM v2

Print
Email
 

Submitted on: 3/20/2002 11:50:28 AM
By: Lewis Moten  
Level: Advanced
User Rating: By 14 Users
Compatibility:ASP (Active Server Pages)

Users have accessed this article 7860 times.
 

(About the author)
 
     No need to purchase expensive components. You can do it all with what you already got. This version is an update for faster speed and reliability. Bugs have been fixed, and the entire code has been commented to walk you through the process.

This article has accompanying files

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.

The secret to the speed lies within ADO's Recordset and Stream objects. The holdback on the previous version was the conversions from ANSI to Unicode, and sometimes back again to ANSI.

Supports multiple file uploads along with multiple field types. Let that user type in a description of the file when they upload it ... etc.

Also supports the ability to retrieve multiple field values with the same name. Although some extra programming would need to be done on your part.

Completely commented walking you through every step along with explinations.

winzip iconDownload article

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzipto decompress it.

Virus note:All files are scanned once-a-day by Planet Source Code for viruses,but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:
1)Re-scan downloaded files using your personal virus checker before using it.
2)NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this article, you agree to the following terms...   
1) You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.


Other 96 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this article(in the Advanced category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments
3/21/2002 4:11:25 AM:Cakkie
Now here's a fine peace of code, nice and easy to use. *****
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/22/2002 2:30:15 AM:Meni
I like it
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/9/2002 12:03:14 PM:ald35
Hey thanks a lot for your code, I am new to this and it really helps. I do have a question though. Is there anyway to upload more than one file at a time? Like an entire folder? Or to have the option of selecting multiple files at once? If you have any suggesstions I would really appreciate it. Thanks again man. ald35
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/9/2002 2:13:28 PM:Sam Moses
Hey Lewis, I'm working on emulating your technique for database uploads, but when I run the new script, I get an error on line 111. Any ideas?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/9/2002 4:37:24 PM:Fabricio
Thanks Lewis, I'll test it in my web host.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/10/2002 11:08:55 AM:Fabricio
Lewis, it works fine at local IIS, but with my web hosting server, I have a folow msg: > ADODB.Stream error '800a0bbc' > Write to file failed. > clsField.asp, line 178 I know that your script is correct, but can you help to find what type of restrictions my web hosting server do ??? What should I request to my web hosting server ??? Special directory, write access to public, quota, etc... Ps.: If you have a free time, email me... Thanks , Fabricio
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/1/2002 12:05:04 PM:Kevin Pirkl
I see some str = str & chr(whatever) kind of code and as we all know string concats are very slow in vb. How well does this handle file uploads of 1mb or more compared to other postings on this site. BTW the Excellent Function and Class BroilerPlates, inline commeting and formatting. I wish all programers took this much care in their work. K
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/24/2002 5:43:31 AM:jelzooi
No problems to inslalll THANKS A LOT
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
8/9/2002 2:34:14 AM:Vivek
Nice piece of code.....
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/3/2002 3:09:39 AM:
Easy to install and reconfigure to my structure. One thing... how can you setup multipul uploads in the one form??
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/3/2002 3:10:39 AM:
Great bit of code mate!!! One thing... is there anyway to set it up to upload 2 files at once??? Lee
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/3/2002 4:51:58 PM:
Works great with one file. How can you set it up to upload two files under the same submit button? If anyone knows how to do this, please let me know.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/5/2002 10:44:17 AM:Lewis Moten
To upload multiple files, use different names for the INPUT element (name=File1, name=File2).
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/12/2002 11:26:33 AM:
Hello: It is very good code instead using 3rd party components. Can I add some others form elements like input fields person name & address ...so on with upload features together in one page. I try, but not successfull. Thanks
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/12/2002 10:12:15 PM:
Lewis... i tried changing the form to 2 inputs with different names as you suggested and it still didn't upload... is there something in the asp that needs to be changed??? Lee
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/12/2002 10:51:21 PM:
Does anyone know how I can get this error fixed? --error --- ADODB.Stream error '800a0bbc' Write to file failed. /dev/clsField.asp, line 178 --ends here-- I've installed a photo album Snitz mod on my forum but it doesn't seem to work due to this error. thanks kindly for any assistance. Armand
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/13/2002 12:29:49 PM:
For uploading 2 fields, I think in ToDatabase.asp files, chnage the code in following will be work. But other good suggestion will welocme. objRs.AddNew objRs.Fields(" FileName").Value = objUpload.Fields("File1").FileName objR s.Fields("FileSize").Value = objUpload.Fields("File1").Length objRs. Fields("ContentType").Value = objUpload.Fields("File1").ContentType o bjRs.Fields("BinaryData").AppendChunk objUpload("File1").BLOB & ChrB(0) objRs.AddNew objRs.Fields("F ileName").Value = objUpload.Fields("File2").FileName objR s.Fields("FileSize").Value = objUpload.Fields("File2").Length objRs. Fields("ContentType").Value = objUpload.Fields("File2").ContentType o bjRs.Fields("BinaryData").AppendChunk objUpload("File2").BLOB & ChrB(0)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/15/2002 8:54:31 PM:
Thanks mate... that code is great, excpet that I am only using the code to upload to a file system... can someone help out for us!!!! Cheers, Lee
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
9/23/2002 6:45:31 PM:
Hi, I've noticed that when you upload very large files (>100 megs on my machine) my server doesn't have enough available memory to deal with this. I'm considering trying to modify the code to process by some chunk size... I dunno, maybe 1024 KB. Since your most familiar with the code, what do you think about modifying it to do something like that? I notice that in the class initialization we read the entire request all of the bytes (mbinData = Request.BinaryRead(mlngBytesReceived)), couldn't we leave that bit out until you actually call SaveAs and in SaveAs read the bytes off the request in chunks? Anyway, I'll check back in a few days... ... while(RequestData) ParseDelimiter ParseData Wend????? Sean Hill shill@transcribing.com
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/13/2002 2:09:43 PM:
Version 1 would overwrite files, but version 2 gives the error message that two others have mentioned, ADODB Stream error '800a0bbc' Write to file failed clsField.asp, line 178 This error appears to be an inability for the include file's objects to overwrite an existing file. We're running on NT 4.0 SP6a and IIS 4.0. Does this have anything to do with the version of IIS? We have the latest version of DAO. Database works great and version 2 handles larger files nicely. Just need to overwrite as version one did. Thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/13/2002 2:10:35 PM:
Version 1 would overwrite files, but version 2 gives the same error message that two others have mentioned, ADODB Stream error '800a0bbc' Write to file failed clsField.asp, line 178 This error appears to be an inability for the include file's objects to overwrite an existing file. We're running on NT 4.0 SP6a and IIS 4.0. Does this have anything to do with the version of IIS? We have the latest version of DAO. Database works great and version 2 handles larger files nicely. Just need to overwrite as version one did. Thanks!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/16/2002 5:31:12 PM:
Great code. I have one question, when I attempt to download a file that I have uploaded, the name field in the save dialog is the name of the datafile.asp. I can retype the name here, but is there a way to automate this? Or is it browser dependant?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/22/2002 5:23:35 AM:
Just what I am looking for. Thank you for your great work!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/24/2002 7:32:13 PM:
Thanks mate... that code is great, excpet that I am only using the code to upload to a file system, and i need to be able to upload 2 files at a time... can someone help out for us!!!! Cheers, Lee
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
10/28/2002 4:15:44 PM:
This is a great piece of code and thanks for sharing it. As a side note, I also got the
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this article has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular article, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ASP/ VbScript Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.