Solved

asp clsUpload BinaryRead problems when uploading file and submitting data

Posted on 2006-10-31
8
1,701 Views
Last Modified: 2012-06-21
Hi guys,

I have an upload file page which contains input text and file elements in a form. The compnent I use to upload is clsUpload.

When i try using request.form("text") is gives:

Cannot use the generic Request collection after calling BinaryRead

Ok, I searched solutions and seems request.querystring("text") is appropraite, but it always takes the value to be NULL when I use method POST, but is ok when using GET. But then GET will not work with uploading files.

What is going wrong? I need to know the method to call the variables from the form in POST method

Thanks~!
0
Comment
Question by:huang_ck
  • 3
  • 2
8 Comments
 
LVL 58

Expert Comment

by:amit_g
ID: 17848001
If your object name is objUpload you need to use objUpload.Fields("text") . You will have a line like this

Set objUpload = new clsUpload

That tells you the name of the object. Use objUpload.Fields("TheFormFieldName") to get any form field value.
0
 

Author Comment

by:huang_ck
ID: 17849524
i get this error after using objUpload.Fields:

Object doesn't support this property or method: 'objUpload.fields'
0
 
LVL 58

Expert Comment

by:amit_g
ID: 17850533
Show us the code that you have now (before the change). Does that code work?
0
 

Author Comment

by:huang_ck
ID: 17851051
here is my script that works:

set objUpload = New clsUpload
objUpload.RestrictFileExtentions = true
'objUpload.SafeFileExtensions = "jpg|gif|png|bmp"
objUpload.SafeFileExtensions = "jpg|gif|bmp"                              
objUpload.Upload ""

strDestination_big = Server.MapPath("../photo/big")

for each item in objUpload.Files
                                          
   'create file object
   set objItem = objUpload.Files(item)
                                          
   'set file destination and save
   objItem.uploadpath = strDestination_big
   objItem.save
   'clean up
   set objItem = nothing

next




It works with no problem, but when I use like: strText = request.form("text")
it has problems
0
 
LVL 58

Accepted Solution

by:
amit_g earned 500 total points
ID: 17851428
Try

strText = objUpload.Form("text")

If this doesn't work, post the clsUpload code or a link where you downloaded it from.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
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 Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

803 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