Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error with request.form

Status
Not open for further replies.

wallgecko

Programmer
Joined
Dec 10, 2001
Messages
5
Location
MY
what is wrong and how do I solve it?

Error Type:
Request object, ASP 0207 (0x80004005)
Cannot use Request.Form collection after calling BinaryRead.
/cs/insert.asp, line 86
 
What does line 86 say? We'll need more info.
 
line 86 <% Response.Write request.form(&quot;qty&quot;)%>

previous page submission:
<input type=&quot;text&quot; name=&quot;qty&quot;>

This is the BinaryRead in the current file above line 86
<%

Response.Buffer = True

' load object
Dim load
Set load = new Loader

' calling initialize method
load.initialize

' File binary data
Dim fileData
fileData = load.getFileData(&quot;file&quot;)
' File name
Dim fileName
fileName = LCase(load.getFileName(&quot;file&quot;))
' File path complete
Dim filePathComplete
filePathComplete = load.getFilePathComplete(&quot;file&quot;)
' File size
Dim fileSizeTranslated
fileSizeTranslated = load.getFileSizeTranslated(&quot;file&quot;)
' Content Type
Dim contentType
contentType = load.getContentType(&quot;file&quot;)
' Path where file will be uploaded
Dim pathToFile
pathToFile = Server.mapPath(&quot;uploaded/&quot;) & &quot;\&quot; & fileName
' Uploading file data
Dim fileUploaded
fileUploaded = load.saveToFile (&quot;file&quot;, pathToFile)

' destroying load object
Set load = Nothing

%>
 
can you post your complete <form> tag?
 
I found out the reason why. The Upload code contains Request.BinaryRead which causes an error subsequently if we use request.form.
Now anyone knows how to solve it?
 
in your <form> tag, need enctype=&quot;multipart/form-data&quot; if you have an <input type=&quot;file&quot;> tag.....

<form name=&quot;yourformname&quot; action=&quot;yourscript.asp&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top