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
%>
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
%>