IE throws error message when downloading a file from ASP.NET web p

G

Guest

I have export to xls functionality in asp.net web form, implemented like this:

Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;
filename=InvChangeHistory.xls");
Response.AddHeader("Content-Length", fileToSend.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(fileToSend.FullName);
Response.End();

when trying to download the file, and choosing Open in the IE dialog IE
throws this error:

Cannot find the C:\Documents and Settings\XXX_XXXX\Local Settings\Temporary
Internet Files\Content.IE5\QGN5CF6S\XXXXXX[1].xls file.

when saving the file, the file gets created in the temp directory and is
saved.

I am a missing a setting in the header, or is it IIS setting. This used to
work on other test web servers.

Thanks.
 
W

Winista

Most of the time this error occurs because of content expiration header
values set to expire the documents immediately. Or if the site is using SSL.
Do you have any of these 2?
 
G

Guest

I don't set the context expiration in the header explicitely. Do I need to do
that ?
The site is not using SSL.

Why is only happen on some test servers ? Is there a setting about this in
IIS as well ? (default expiration or something)

Winista said:
Most of the time this error occurs because of content expiration header
values set to expire the documents immediately. Or if the site is using SSL.
Do you have any of these 2?

OliviuG said:
I have export to xls functionality in asp.net web form, implemented like
this:

Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;
filename=InvChangeHistory.xls");
Response.AddHeader("Content-Length", fileToSend.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(fileToSend.FullName);
Response.End();

when trying to download the file, and choosing Open in the IE dialog IE
throws this error:

Cannot find the C:\Documents and Settings\XXX_XXXX\Local
Settings\Temporary
Internet Files\Content.IE5\QGN5CF6S\XXXXXX[1].xls file.

when saving the file, the file gets created in the temp directory and is
saved.

I am a missing a setting in the header, or is it IIS setting. This used to
work on other test web servers.

Thanks.
 

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,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top