473,388 Members | 1,939 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 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 1777
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rhon Stewart via DotNetMonster.com | last post by:
Hi please visit this link : http://www.eggheadcafe.com/articles/pfc/selfupdater.asp I followed all the steps for listed on the link , when I execute the application it it gives me the following...
5
by: Nathan Sokalski | last post by:
I am trying to write code to allow my users to upload a file. The code I am using is as follows: Dim upfilename As String = "" If fileDetails.Value <> "" AndAlso...
0
by: Mamatha | last post by:
Hi i have one ASP page,when i click a download button in that page it downloads a file from net,and the file size is nearly 70MB,so while at the time of downloading a file the asp page...
3
by: Ramesh Dodamani | last post by:
Environment: XP Pro, VS.Net 2003, .Net 1.1.4322 with SP1 & KB Hotfix 886903 P4 2.2GHz, 1 GB RAM My system was working fine till a few weeks back when I started seeing the following errors. ...
2
by: Tomas Martinez | last post by:
Hi there! I'm trying to download a file in my asp.net web, but when downloading it from a Firefox browser, instead of downloading the example.exe file, it's downloading example.exe.htm. My code...
0
by: ruju00 | last post by:
I am getting an error in Login() method of the following class FtpConnection public class FtpConnection { public class FtpException : Exception { public FtpException(string message) :...
0
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi all! I am having problems on installing .NET Framework 3.5 on some machines. In one machine the error is: WinVerifyTrust returned -2146762751 Wintrust not on machine Error: O arquivo...
3
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
Hi all! I am having problems on installing .NET Framework 3.5 on some machines. In one machine the error is: '.NET Framework 3.5' RunCheck result: Install Needed Verifying file integrity of...
1
by: csharpula csharp | last post by:
Hello, I am trying to download a file and get a current error: Download(...): Unable to download file Access to the path 'C:\Temp\aaa.zip' is denied. While I was downloading with this code:...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.