Upload Files Without COM v2

Submitted on: 1/6/2015 2:41:00 AM
By: Lewis E. Moten III (from psc cd)  
Level: Advanced
User Rating: By 52 Users
Compatibility: ASP (Active Server Pages)
Views: 19786
     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


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 Winzip to 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

Other 63 submission(s) by this author


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

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

6/23/2016 6:31:16 PMDJ

so i'm trying to run the code and right off the bat, I get a Invalid Procedure MidB. That MidB doesn't exist.
(If this comment was disrespectful, please report it.)

11/17/2017 1:30:42 AMJu2c0c0

For future reference: make sure to add
to the form tag. This is needed for clsUpload since it parses the form data at initialisation. Otherwise the MidB error will appear because it tries to parse "bad" formatted form data.

There is also a missing Exit Property after line 445. Without that, trying to access a field using an index like objUpload(0) for exemple will return an empty clsField.

Also, the clsField.FileName property may not be initialized because it is extracted from the FilePath only if it is a path containing the "\" character.
In that case, access the FilePath property directly.
(If this comment was disrespectful, please report it.)


Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.