Solved

asp clsUpload BinaryRead problems when uploading file and submitting data

Posted on 2006-10-31
8
1,745 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
[X]
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
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

687 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