ServerXMLHTTP failing with large binary files

Discussion in 'ASP General' started by Steve Troxell, Nov 12, 2003.

  1. I am trying to use ServerXMLHTTP in an ASP page to return a binary file
    download to the browser. It works just fine with small files ( under 1 MB)
    but seems to fail with large files (4 MB, 11 MB in tests). A success would
    be that the browser kicks off the "Save As" file dialog. The failures are
    not always the same. Sometimes the browser tries to download the ASP file
    itself. Sometimes the the file seems to download successfully, but for
    example only 1.6 MB of a 4 MB file are actually downloaded and it doesn't
    seem to be a simple truncation. Sometimes I get "internal server error 500".
    Below is my ASP code. "Project1.exe" is small enough to be successful. If
    you substitute "OmniViewProSetup.exe" (4 MBs) it will fail.

    <%
    Response.Buffer = True
    Dim xml
    Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")

    xml.Open "GET",
    "http://www.krell-software.com/downloads/test/project1.exe", False
    xml.Send

    Response.AddHeader "Content-Disposition", "attachment;
    filename=project1.exe"
    Response.ContentType = "application/octet-stream"
    Response.BinaryWrite xml.responseBody

    Set xml = Nothing

    %>

    --
    Steve Troxell
    Krell Software - Database Tools for MS SQL Server
    http://www.krell-software.com
    Steve Troxell, Nov 12, 2003
    #1
    1. Advertising

  2. Hi,

    Probably the page falls by timeout...

    You review the page, if you have a Server.ScriptTimeout = 0, else you writes
    it in the begin of the page.

    Sorry for my english!!!!...

    --
    Saludos,
    Jhonny Vargas P. [MS MVP]
    Santiago de Chile




    "Steve Troxell" <> wrote in message
    news:...
    > I am trying to use ServerXMLHTTP in an ASP page to return a binary file
    > download to the browser. It works just fine with small files ( under 1 MB)
    > but seems to fail with large files (4 MB, 11 MB in tests). A success would
    > be that the browser kicks off the "Save As" file dialog. The failures are
    > not always the same. Sometimes the browser tries to download the ASP file
    > itself. Sometimes the the file seems to download successfully, but for
    > example only 1.6 MB of a 4 MB file are actually downloaded and it doesn't
    > seem to be a simple truncation. Sometimes I get "internal server error

    500".
    > Below is my ASP code. "Project1.exe" is small enough to be successful. If
    > you substitute "OmniViewProSetup.exe" (4 MBs) it will fail.
    >
    > <%
    > Response.Buffer = True
    > Dim xml
    > Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
    >
    > xml.Open "GET",
    > "http://www.krell-software.com/downloads/test/project1.exe", False
    > xml.Send
    >
    > Response.AddHeader "Content-Disposition", "attachment;
    > filename=project1.exe"
    > Response.ContentType = "application/octet-stream"
    > Response.BinaryWrite xml.responseBody
    >
    > Set xml = Nothing
    >
    > %>
    >
    > --
    > Steve Troxell
    > Krell Software - Database Tools for MS SQL Server
    > http://www.krell-software.com
    >
    >
    Jhonny Vargas P. [MVP], Nov 12, 2003
    #2
    1. Advertising

  3. Jhonny Vargas P. [MVP] wrote:
    > Hi,
    >
    > Probably the page falls by timeout...
    >
    > You review the page, if you have a Server.ScriptTimeout = 0, else you
    > writes it in the begin of the page.


    I don't believe it's a timeout issue. I set Server.ScriptTimeout = 600 and
    still had problems. It sometimes takes a few seconds, but never more than
    that.

    --
    Steve Troxell
    Krell Software - Database Tools for MS SQL Server
    http://www.krell-software.com
    Steve Troxell, Nov 13, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lopi
    Replies:
    8
    Views:
    167
  2. Anthony Papillion
    Replies:
    0
    Views:
    82
    Anthony Papillion
    Aug 13, 2013
  3. Chris Angelico
    Replies:
    0
    Views:
    81
    Chris Angelico
    Aug 13, 2013
  4. Dave Angel
    Replies:
    0
    Views:
    96
    Dave Angel
    Aug 13, 2013
  5. MRAB
    Replies:
    0
    Views:
    81
Loading...

Share This Page