473,322 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

File uploading mixed with form input

I've been browsing around the web for an answer to this and I can't
find a good answer to it.... here's the problem:

I am using an ASP include file called "ClsUpload.asp" to upload a text
file for processing. I also have a select drop down that i am
submitting along with the file, in order to determine where in the
database this info goes. My problem is that I can upload the file
without any problems, but I can't get at the select field at all. I
first tried using the normal "Request("Listid")" function, but that
didn't work (At first I was using it after the file upload and it gave
me an error message. Then I moved it to before the upload and it
doesn't give me an error anymore, but also doesn't seem to see
anything).

Then I tried request.form("listid"), which some of the discussions on
the web point to. The code still sees nothing at all being submitted. I
tried it both before and after the file upload....

I don't see any info on doing something like this within the
clsupload.asp file, so I'm thinking that the problem is stemming from
my use of the enctype="multipart/form-data" tag.

How can I do this? I suppose that if worst comes to worst, i can just
break the form up accross two pages and use it like that, but that
seems kind of ugly. Is there a simple way around this?

Jul 11 '06 #1
5 5210
On Tue, 11 Jul 2006 09:03:48 -0500, furby <Wo*******@gmail.comwrote:
I am using an ASP include file called "ClsUpload.asp" to upload a text
file for processing. I also have a select drop down that i am
submitting along with the file, in order to determine where in the
database this info goes. My problem is that I can upload the file
without any problems, but I can't get at the select field at all.
These classes (and also their COM counterparts) work by manually
processing the form data submitted by the browser, which renders the
Request.Form collection inoperable. Normally they expose their own Form
collection so that this data is still available. If your upload utility
doesn't have such functionality, you might consider using the one from
http://www.freeaspupload.net/ instead.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Jul 11 '06 #2
"furby" <Wo*******@gmail.comwrote:
>I've been browsing around the web for an answer to this and I can't
find a good answer to it.... here's the problem:

I am using an ASP include file called "ClsUpload.asp" to upload a text
file for processing. I also have a select drop down that i am
submitting along with the file, in order to determine where in the
database this info goes. My problem is that I can upload the file
without any problems, but I can't get at the select field at all. I
first tried using the normal "Request("Listid")" function, but that
didn't work (At first I was using it after the file upload and it gave
me an error message. Then I moved it to before the upload and it
doesn't give me an error anymore, but also doesn't seem to see
anything).

Then I tried request.form("listid"), which some of the discussions on
the web point to. The code still sees nothing at all being submitted. I
tried it both before and after the file upload....

I don't see any info on doing something like this within the
clsupload.asp file, so I'm thinking that the problem is stemming from
my use of the enctype="multipart/form-data" tag.
Basically, yes. The 'enctype="multipart/form-data"' tag causes the
contents of the form - including any files specified by <input
type="file"....tags as well as more normal tags - to be transmitted
in MIME format. All the data is there, and if the component you're
using to untangle the MIME blob isn't giving you the contents of the
"normal" tags, then it's not doing its job. I'm sure you can find
something that will work properly.

--
Tim Slattery
MS MVP(DTS)
Sl********@bls.gov
Jul 11 '06 #3
Freeaspupload.asp works like a charm - thanks. Now, for the next
question and it relates directly to that particular class.

How do I retrieve the name of the uploaded file? I see a second class
named "UploadedFile" but there is no documentation for it. The
documentation refers to the filename property of the main object, but
that doesn't work...

Justin Piper wrote:
On Tue, 11 Jul 2006 09:03:48 -0500, furby <Wo*******@gmail.comwrote:
I am using an ASP include file called "ClsUpload.asp" to upload a text
file for processing. I also have a select drop down that i am
submitting along with the file, in order to determine where in the
database this info goes. My problem is that I can upload the file
without any problems, but I can't get at the select field at all.

These classes (and also their COM counterparts) work by manually
processing the form data submitted by the browser, which renders the
Request.Form collection inoperable. Normally they expose their own Form
collection so that this data is still available. If your upload utility
doesn't have such functionality, you might consider using the one from
http://www.freeaspupload.net/ instead.

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Jul 11 '06 #4
On Tue, 11 Jul 2006 15:14:16 -0500, furby <Wo*******@gmail.comwrote:
Freeaspupload.asp works like a charm - thanks. Now, for the next
question and it relates directly to that particular class.

How do I retrieve the name of the uploaded file? I see a second class
named "UploadedFile" but there is no documentation for it. The
documentation refers to the filename property of the main object, but
that doesn't work...
There's an UploadedFiles property that exposes a Scripting.Dictionary
object with information about all the files uploaded. Something like
this should do the trick:

Dim upload, file
Set upload = New FreeASPUpload
For Each file In upload.UploadedFiles.Items()
Response.Write file.FileName & "<br>" ' or whatever you like
Next

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Jul 12 '06 #5
Excellent! Thank you very much - works like a chamr!

Justin Piper wrote:
On Tue, 11 Jul 2006 15:14:16 -0500, furby <Wo*******@gmail.comwrote:
Freeaspupload.asp works like a charm - thanks. Now, for the next
question and it relates directly to that particular class.

How do I retrieve the name of the uploaded file? I see a second class
named "UploadedFile" but there is no documentation for it. The
documentation refers to the filename property of the main object, but
that doesn't work...

There's an UploadedFiles property that exposes a Scripting.Dictionary
object with information about all the files uploaded. Something like
this should do the trick:

Dim upload, file
Set upload = New FreeASPUpload
For Each file In upload.UploadedFiles.Items()
Response.Write file.FileName & "<br>" ' or whatever you like
Next

--
Justin Piper
Bizco Technologies
http://www.bizco.com/
Jul 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Dave Smithz | last post by:
Hi There, I have a PHP script that sends an email with attachment and works great when provided the path to the file to send. However this file needs to be on the same server as the script. ...
4
by: M P | last post by:
Can you help me find an asp code that will upload a file from my PC to web server? Mark
4
by: Shawn Mesiatowsky | last post by:
I have an html form that accepts a file for uploading, but I wanted to create a program to automate the upload procedure. I beileive you use the Webresponse class, but I was not sure how to use...
13
by: Sky Sigal | last post by:
I have created an IHttpHandler that waits for uploads as attachments for a webmail interface, and saves it to a directory that is defined in config.xml. My question is the following: assuming...
7
by: pbd22 | last post by:
hi. i am having probs understanding how to grab a file being uploaded from a remote client. i am using hidden input fields for upload such as: <input id="my_file_element" type="file"...
3
acoder
by: acoder | last post by:
How to Upload a File in Coldfusion Use the cffile tag for uploading files to the server. Note that allowing people to upload files is fraught with danger and only trusted users should be...
3
ganesanji
by: ganesanji | last post by:
hi all, I have written a php coding for uploading a file to a specific folder or location in server which is a Linux server. I think the coding for file uploaing is correct. But it does not...
1
by: chrisj | last post by:
I'm using freeASPupload and got some assistance integrating to a Member script. It works successfully. In this modified version there are two groups that use this upload script. Members of one...
4
rahulephp
by: rahulephp | last post by:
i think i am missing something in the below script: It shows error an do not upload files to destination: Let me know how to solve this: <?php if (isset($_POST)) { $uploadArray=...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.