|
|
|
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.
| |
Download 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 |
|
|
Your Vote! |
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. *****
|
3/22/2002 2:30:15 AM:Meni I like it
|
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
|
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?
|
4/9/2002 4:37:24 PM:Fabricio Thanks Lewis, I'll test it in my web
host.
|
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
|
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
|
5/24/2002 5:43:31 AM:jelzooi No problems to inslalll
THANKS A LOT
|
8/9/2002 2:34:14 AM:Vivek Nice piece of code.....
|
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??
|
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
|
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.
|
9/5/2002 10:44:17 AM:Lewis Moten To upload multiple files, use different
names for the INPUT element
(name=File1, name=File2).
|
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
|
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
|
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
|
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)
|
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
|
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
|
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!
|
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!
|
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?
|
10/22/2002 5:23:35 AM: Just what I am looking for.
Thank
you for your great work!!!
|
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
|
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
|
|
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. |
|