473,507 Members | 13,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
Jul 19 '05 #1
3 6771
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" <st***********@hotmail.spamBgone.com> wrote in message
news:uG**************@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

Jul 19 '05 #2
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
Jul 19 '05 #3
mregueira
1 New Member
It's an old thread but it's still unanswered.

Usually asp has a 4mb buffer for response. So if you are returning a bigger file then it's sure download will fail.

First you should disable buffering.

Response.Buffer=false

then iterate to write in chunks smaller than 4mb with

response.binarywrite

hope it helps
Apr 27 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
3100
by: Marc | last post by:
Hello, I have a page where i can upload binary file (using the HTML input type=file approach). This works fine for relatively small files (<6MB)) but when files get bigger (13MB) there is a...
5
17845
by: katrinaVictim | last post by:
Question: I get the eror listed at the bottom of the post. What can I do to make the response of the x1.send a "binary" type? Or, in general, how can I just "make this work"? <%@...
11
5836
by: CSN | last post by:
Is it possible to iterate over an array in plpgsql? Something like: function insert_stuff (rel_ids int) .... foreach rel_ids as id insert into table (rel_id, val) values (id, 5);
2
8716
by: Maris Janis Vasilevskis | last post by:
Hi, Is it possible to force HttpWebRequest to do exactly (not approximately) the same as MSXML2.ServerXMLHTTP does? More details. I port JScript to JScript.NET I have a server (ASP invoking...
2
4607
by: gauravkhanna | last post by:
Hi All I need some help for the below problem: Scenario We need to send large binary files (audio file of about 10 MB or so) from the client machine (.Net Windows based application, located...
7
2394
by: Ed McNierney | last post by:
I'm trying to use ServerXMLHTTP on an ASP (not ASP.NET) page to retrieve large binary data from a remote server. When the request is large (more than a few megabytes), the ServerXMLHTTP page jumps...
2
1943
by: jdev8080 | last post by:
We are looking at creating large XML files containing binary data (encoded as base64) and passing them to transformers that will parse and transform the data into different formats. Basically,...
3
2351
by: sebastian.harko | last post by:
Helllo, What's the general accepted strategy for dealing with very large binary files in C# ? I have to do a program that reads some "multi frame bitmap " files which can reach up to one...
17
9868
by: byte8bits | last post by:
How does C++ safely open and read very large files? For example, say I have 1GB of physical memory and I open a 4GB file and attempt to read it like so: #include <iostream> #include <fstream>...
0
7314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7030
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1540
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.