Any1 familiar with request.totalbytes and why it wont process files sent from the clients browser that say over 400 kb?
Any1 familiar with request.totalbytes and why it wont process files sent from the clients browser that say over 400 kb?
is the file size sent in request.totalbytes or in the asp control for the posted file?
Cultured in Aggression and Koding like a Warrior!!
“Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
"The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein
Request.totalbytes stores the total amount of data sent to the web server from an html form
Why do you say it's not processing files over 400kb?
And are you using just a plain form or using an asp control or a file upload tool?
Using regular ASP or .NET?
Last but not least, vould we take a look at part of the code that is using the totalbytes code?
im using regular asp
HTML FILE
<HTML>
<FORM METHOD=POST ACTION="file.asp" ENCTYPE="multipart/form-data">
<INPUT TYPE=file NAME=Item1>
<INPUT TYPE=SUBMIT>
</FORM>
</HTML>
asp file
Dim Data
Dim CurrentPos
dim n
Server.ScriptTimeout = 900
n = Request.TotalBytes
Data = Request.BinaryRead(n)
'''''''''''''Displays what is sent to the web server''''''''''''''''''''
For i = 1 to lenb(Data)
response.write(MidB( Data , i, 1 ))
next
'''''''''''''Displays what is sent to the web server''''''''''''''''''''
'parse Data
CurrentPos = InStrb(1,Data,chrb(ascb("/")),0)
Data =Midb(Data,CurrentPos+2)
CurrentPos = InStrb(1,Data,chrb(13),0)
Data =Midb(Data,CurrentPos+4)
response.write("<br><br>")
'''''''''''dispay data after parsing
For i = 1 to lenb(Data)
response.write(MidB( Data , i, 1 ))
next
Dim oFS, oFile
Dim nIndex
Set oFS = Server.CreateObject("Scripting.FileSystemObject")
Set oFile = oFS.CreateTextFile(Server.MapPath("Texto.txt"), True)
For i = 1 to LenB(Data)
oFile.Write Chr(AscB(MidB(Data,i,1)))
Next
Do you get an error message of some sort.
From the look of the code. My guess would be that it timesout before the file is finished uploaded. So it might upload a corrupted file or just don't upload at all.
try changing Server.ScriptTimeout = 900 to Server.ScriptTimeout = 9000
Last edited by redbwoy; Aug 14, 2007 at 08:20 AM.
ok im going to try that. i have not received an error its just there loading...
ok the upload worked but it took more than an hour to upload a 1.22 MB file, i dont know why it was so slow. im using IIS 5.1 i dont know if that could be part of the problem
Well IIS 5.1 has a number of issues thats why we are up to IIS 7.0 now. But IIS will only play a role if you had some permission errors and file location errors.
Your issue however could steam from a number of things. Double check your connection speeds, such as your upload speed and also your server processing speed.
hey thx for the help. btw im only using IIS on my home computer coz it came with xp hopefully when i move to a web server the uploading will be better