File uploading mixed with form input

F

furby

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?
 
T

Tim Slattery

furby said:
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.
 
F

furby

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...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top