ServerXMLHTTP failing with large binary files

S

Steve Troxell

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

%>
 
J

Jhonny Vargas P. [MVP]

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!!!!...
 
S

Steve Troxell

Jhonny said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top