asp clsUpload BinaryRead problems when uploading file and submitting data

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

Who is Participating?
amit_gConnect With a Mentor Commented:

strText = objUpload.Form("text")

If this doesn't work, post the clsUpload code or a link where you downloaded it from.
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.
huang_ckAuthor Commented:
i get this error after using objUpload.Fields:

Object doesn't support this property or method: 'objUpload.fields'
Show us the code that you have now (before the change). Does that code work?
huang_ckAuthor Commented:
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
   'clean up
   set objItem = nothing


It works with no problem, but when I use like: strText = request.form("text")
it has problems
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.