Receive server error while downloading file using Response.BinaryW

G

Guest

I have been getting the following server errors sporadically while
downloading excel, csv or xml file.

Internet Explorer cannot download <file name> from <IP address>
"The server returned an invalid or unrecognized response" /
"The connection with the server was reset"

I'm using Response.BinaryWrite to send down the file content as attachment
(sample codes is attached below). I read some of the similar posts in the
newsgroup about the size of the download that may have caused this error.
After some testing with different size of download(12KB to 40MB), it doesn't
seem to make any difference. Even the 12KB download sometimes gets the error.


I have checked the file format , IIS log file and event log and they all
seems to be fine. I am hitting the wall here and I greatly appreciate it if
anyone can help. BTW, I am using IIS 6 on Win 2003 server. Thanks.

------------------------------------------------------------------------------
Response.ContentType = "application/excel";
Response.AddHeader("Content-Disposition", "attachment; filename=report.xls");
Response.BinaryWrite(byteContent);
Response.Flush();
Response.Close();
 
G

Guest

Thanks for your reply.
In fact, the downloaded file is a byte array coming out from SQL Server
Reporting Service. I don't have the actual file stored in the server. It is
why I can't use the WriteFile().

I'll definitely try to clear the response first and retest it again.


-----------------------------------------------------------------------------
 
G

Guest

Sorry... :eek:(
I did have the Response.ClearContent(); call in the codes before setting up
the response stream for attachment.


---------------------------------------------------------------------------
 

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

Forum statistics

Threads
473,756
Messages
2,569,533
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top