Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_discuss thread: Get form values in a enctype="multipart/form-data"


Message #1 by Charlie McCormack <Charlie.McCormack@t...> on Wed, 27 Jun 2001 16:46:58 +1000
Hi,



can someone tell me why I cant get form values with a

request.form("Element") command when using enctype="multipart/form-data" in

the form,

and is there another way to get form values when using this type of form?





TIA

Charlie
Message #2 by "ambrose anandraj" <a_anandraj@h...> on Wed, 27 Jun 2001 23:42:15
Hai..



Your have to use enctype="multipart/form-data"  only when ur uploading a 

file if u have used enctype="multipart/form-data" in ur form then the data 

will be transfered as bytes so u have to get the values using 

request.binaryread if u use this then u will get all the data in binary...



then u have to separate all the values usually they will not use any other 

text boxes while uploading a file i am noy sure that u r uploading a file 

r not..anyhow let me know in details.



Hope this will help u ...



regards



anand



>Subject: Get form values in a enctype="multipart/form-data" 

>From: Charlie McCormack 

>Date: Wed, 27 Jun 2001 16:46:58 +1000 

>X-Message-Number: 1 

> 

>Hi, 

> 

>can someone tell me why I cant get form values with a 

>request.form("Element") command when using enctype="multipart/form-data" in 

>the form, 

>and is there another way to get form values when using this type of form? 

> 

> 

>TIA 

>Charlie 



Message #3 by "Birgitta Dahl" <birgittadahl@y...> on Thu, 28 Jun 2001 22:52:30 +0200
>Hi,

>

>can someone tell me why I cant get form values with a

>request.form("Element") command when using enctype="multipart/form-data" in

>the form,

>and is there another way to get form values when using this type of form?

>

>

>TIA

>Charlie



You can retreave the information using Request.BinaryRead, the code below

would

retreave and print out the form...



binFormData = Request.BinaryRead(Request.TotalBytes)

Response.BinaryWrite(binFormData)



If you post a small textfile to the script the output would be something

like this:



-----------------------------7d116a31e029a

Content-Disposition: form-data; name="file"; filename="C:\tmp.txt"

Content-Type: text/plain



I'm a textfile.

-----------------------------7d116a31e029a--



With a few simple moves you can, obviously, retreave the file content along

with it's

name and content-type (finding the first double CR LF to find out where the

actual

data starts etc, there are probably alot of examples of doing this to be

found on the net).



Danny




  Return to Index