![]() |
ServerXMLHTTP failing with large binary files
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 |
Re: ServerXMLHTTP failing with large binary files
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" <steve_troxell@hotmail.spamBgone.com> wrote in message news:uGbOA8RqDHA.2636@tk2msftngp13.phx.gbl... > 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 > > |
Re: ServerXMLHTTP failing with large binary files
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 |
| All times are GMT. The time now is 12:43 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.