471,093 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,093 software developers and data experts.

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

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.
Jul 4 '06 #1
2 1707
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" <Ol*****@discussions.microsoft.comwrote in message
news:2D**********************************@microsof t.com...
>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.

Jul 5 '06 #2
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" wrote:
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" <Ol*****@discussions.microsoft.comwrote in message
news:2D**********************************@microsof t.com...
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.


Jul 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Rhon Stewart via DotNetMonster.com | last post: by
5 posts views Thread by Nathan Sokalski | last post: by
reply views Thread by Mamatha | last post: by
3 posts views Thread by Ramesh Dodamani | last post: by
2 posts views Thread by Tomas Martinez | last post: by
reply views Thread by =?Utf-8?B?VmFuZXNzYQ==?= | last post: by
3 posts views Thread by =?Utf-8?B?VmFuZXNzYQ==?= | last post: by
1 post views Thread by csharpula csharp | last post: by

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.