Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Forms with 'multipart/form-data' & Request.Form 1

Status
Not open for further replies.

Gatchaman

Programmer
Jan 21, 2003
71
AU
Hey all,

I have a page that does several things. There is images associated with a case, and the page shows the case and all associated images. Then there is a section where you can add a new image, which the uses "Jacob Gilley's" ASP file uploader.

The thing is, to get the uploading working, you need to have enctype="multipart/form-data" in the form tag, however, the page also has to do other things, such as save the changes to the database, and when I have multipart/form-data the form acts differently (I think) and Request.Form("whatever") returns nothing on the page.

Can anyone tell me of a way to get stuff out of a form in asp that uses multipart/form-data ? Or, alternatively, I tried javascript so that when you click the upload button, it changes the enctype from "" to "multipart/form-data", and when you click the save button changes the enctype to "".

This, however, didn't seem to make a difference.

Thanks in advance for any help.

Damon
 
I had problems with multipart/form-data once, too. IIRC I had to refer to the form variables as
Code:
    Request("whatever")
rather than Request.Form("whatever"). That or I had to iterate through the collection.
 
Thanks for your quick response Genimuse, I've tried Request() instead of Request.Form(), but to no avail.

I was wondering, how do you iterate through the collection. Also, on another note, is there any quick command you can use in ASP that does a dump (and writes it) off all the data posted to a page ? If you get what I mean.
 
When you use enctype="multipart/form-data", you cannot use Request.Form anymore. Read the manual of "Jacob Gilley's" ASP file uploader (is it a COM?). I use Dundas COM, and must use its method to get value.
 
You would iterate through the collection like this:
Code:
  For Each myItem in Request.Form
    Response.Write(myItem & &quot; is &quot; & Request.Form(myItem) & &quot;<br>&quot;)
  Next
and
Code:
  For Each myItem in Request.Querystring
    Response.Write(myItem & &quot; is &quot; & Request.Querystring(myItem) & &quot;<br>&quot;)
  Next
 
Thanks phuctran, I will look into that right now, i was just thinking that I would have to use the method for the uploader in all the other pages. i'm not sure if we have the manual or documentation anymore, it's just an ASP page with classes in VB, not COM.

I'll have to download it agian and check, will post back here with progress.
 
Well, thanks Genimuse, I never knew how to iterate through that, I've tested it seperately, and it works great, answered both my questions (about the iteration and the dumping). But, unfortunately, it didn't work.

I couldn't find the doc for the ASP uploader, but I tried it's method of getting the data you posted and all my pages are now working fine. Cheers.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top