Uploading file to web server using ASP

Request.Binaryread   throws error-  007~ASP 0101~Unexpected error~The function returned |.   I tried different approaches but it always fails in binary read method, it seems system is not able to handle the memory allocation,  I dont see any size  restrictions in the binaryread documentation. I am able to upload the file 65 mb just fine. I changed the metabase.xml to upload up to 2 gig, its windows 2003 server
If I directly write request.totalbytes to log file the byte count is correct
when i do this binread = request.TotalBytes the number of bytes in binread is incorrect

its fails here - ado_stream.Write request.BinaryRead(request.TotalBytes)

Please help..I am just cant figure out waht going wrong
port_blair2001Asked:
Who is Participating?
 
GawaiConnect With a Mentor Commented:
post your full code so that i could trace out the bug
0
 
GawaiCommented:
lets see your code. can u post it here ?
0
 
port_blair2001Author Commented:
requestFname = request.querystring("fname")

set ado_stream = Server.CreateObject("ADODB.Stream")
   
   ado_stream.Type = 1  ' 1=adTypeBinary
   ado_stream.open  
   ado_stream.Write request.BinaryRead(request.TotalBytes)   - It fails here
  ado_stream.SaveToFile server.MapPath("\Temp\cache\") & "\" & requestFname ,2
   ado_stream.close
   set ado_stream = Nothing
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
GawaiCommented:
ado_stream.SaveToFile server.MapPath("\Temp\cache\") & "\" & requestFname ,2
did u try to change it to :
ado_stream.SaveToFile server.MapPath("\Temp\cache\") & requestFname ,2
0
 
port_blair2001Author Commented:
Yes, sorry it was a typo
0
 
GawaiCommented:
but wats the outcome ? still have same problem or it is fixed ?
0
 
port_blair2001Author Commented:
still have the same problem
0
 
GawaiCommented:
why dont you post your full code ?

or just try free script from
http://www.asp101.com/articles/jacob/scriptupload.asp
0
 
port_blair2001Author Commented:
I tried ur suggestion but stlll the same error mesage 007~ASP 0101~Unexpected error~The function errored out  at reuqest.binaryread
0
 
port_blair2001Author Commented:
anybody with ideas please
0
All Courses

From novice to tech pro — start learning today.