473,385 Members | 1,518 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,385 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 1776
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:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.