Solved

ENCTYPE="multipart/form-data"/Request.BinaryRead issues

Posted on 2004-05-01
6
5,553 Views
Last Modified: 2010-08-05
Hi,

 I have a form with multiple fields of all types including: hidden, text, radio buttons etc. I also have one field name that is type: File - I used the ENCTYPE="multipart/form-data" in my form tag and request.form doesn't work. I did some research online and I didn't get a clear answer as to what my solution should be.

If I have the ENCTYPE="multipart/form-data" does that mean that request.form will NEVER work?

If I have a field name with type: file do I HAVE to USE ENCTYPE="multipart/form-data" in order for the file to be uploaded properly?

If ENCTYPE="multipart/form-data"  and type="file" work hand in hand with each other can someone give me some code to access the other fields excluding the file field (I've used the Pure ASP File Upload functionality to upload my file http://www.asp101.com/articles/jacob/scriptupload.asp) but I do have to process the other fields.

Thank you for all your help,
Aviva
0
Comment
Question by:avivak1
6 Comments
 
LVL 21

Expert Comment

by:ap_sajith
ID: 10970043
You have to use ENCTYPE="multipart/form-data" for the file upload to work. And request.Form collection is unavailable when you use it. Instead in-order to access the forms collection, your upload script would have provided a collection similar to the Request.Form collection. looking at the upload class that you are using, you can access the form collection by calling uploader.Form("fieldname")

eg:

<%
  Dim MyUploader
  Set MyUploader = New FileUploader
  MyUploader.Upload()
Response.Write MyUploader.Form("txtName")
%>

Hope this helps...

Cheers!!
0
 

Author Comment

by:avivak1
ID: 10972568
Thanks, it did.

Regards,
Aviva
0
 
LVL 21

Accepted Solution

by:
ap_sajith earned 250 total points
ID: 10974545
Please  close this question off by accepting my previous comment.

Cheers!!
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 28

Assisted Solution

by:sybe
sybe earned 50 total points
ID: 10975624
Just a sidenote: Look at http://www.taka.nl/programming/asp/comparing_fileupload.asp and see that pure-script upload solution that you are using is not a very good one (slow and missing some basic functionality).
0
 

Author Comment

by:avivak1
ID: 10982073
Dear Sybe,

Thanks so much for your help - I decided to change uploading scripts and the freeASPUpload is super speedy thanks to you!

0
 
LVL 1

Expert Comment

by:CIT_DEV
ID: 11153668
It is late but i thought i would answer this question.

Use [FileUploader object].Form to access additional form variables submitted with
the file upload(s).

ie if you have a text field on the form with the name "iInspectID" use it as

iInspectID=Uploader.Form("iInspectID")

Enjoy
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now