Solved

asp clsUpload BinaryRead problems when uploading file and submitting data

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

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 discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 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

17 Experts available now in Live!

Get 1:1 Help Now