Results 1 to 10 of 10

Thread: Request.Totalbytes

  1. #1
    Join Date
    Dec 2004
    Posts
    46
    Rep Power
    0

    Default Request.Totalbytes

    Any1 familiar with request.totalbytes and why it wont process files sent from the clients browser that say over 400 kb?

  2. #2
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    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

  3. #3
    Join Date
    Dec 2004
    Posts
    46
    Rep Power
    0

    Default

    Request.totalbytes stores the total amount of data sent to the web server from an html form

  4. #4
    Join Date
    Apr 2003
    Posts
    13,269
    Rep Power
    34

    Default

    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?

  5. #5
    Join Date
    Dec 2004
    Posts
    46
    Rep Power
    0

    Default

    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

  6. #6
    Join Date
    Jul 2006
    Posts
    239
    Rep Power
    0

    Default

    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.

  7. #7
    Join Date
    Dec 2004
    Posts
    46
    Rep Power
    0

    Default

    ok im going to try that. i have not received an error its just there loading...

  8. #8
    Join Date
    Dec 2004
    Posts
    46
    Rep Power
    0

    Default

    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

  9. #9
    Join Date
    Jul 2006
    Posts
    239
    Rep Power
    0

    Default

    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.

  10. #10
    Join Date
    Dec 2004
    Posts
    46
    Rep Power
    0

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •