Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

asp clsUpload BinaryRead problems when uploading file and submitting data

Posted on 2006-10-31
8
1,709 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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/…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

790 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