Link to home
Start Free TrialLog in
Avatar of port_blair2001
port_blair2001

asked on

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
Avatar of Emad Gawai
Emad Gawai
Flag of United Arab Emirates image

lets see your code. can u post it here ?
Avatar of port_blair2001
port_blair2001

ASKER

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
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
Yes, sorry it was a typo
but wats the outcome ? still have same problem or it is fixed ?
still have the same problem
why dont you post your full code ?

or just try free script from
http://www.asp101.com/articles/jacob/scriptupload.asp
I tried ur suggestion but stlll the same error mesage 007~ASP 0101~Unexpected error~The function errored out  at reuqest.binaryread
anybody with ideas please
ASKER CERTIFIED SOLUTION
Avatar of Emad Gawai
Emad Gawai
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial