The amazing adventures of Doug Hughes

I recently ran into a bizarre problem. On one particular II6 server, and not another, I was unable to download CSS and JS files when using Internet Explorer. I kept getting the message, “Internet Explorer cannot download FileName from WebServer“. I could download the files using Firefox. I even used telnet and manually sent an http request which correctly returned data. Very Odd.

The scenario is this: I have a particular application installed on four IIS servers: mine, my cube neighbors, a development server and another development server in a different office. Both my server and my neighbors server are IIS 5.1 running on Windows XP Pro. The two development servers are IIS 6 on Windows Server 2003.

I was experiencing a problem in a particular potion of the application when used from the local development server. (The problem being that the page just didn’t do a damn thing!) So, in the effort to debug the problem I viewed the page source and tried to download the JavaScript file which controls the page’s behavior. When it wouldn’t download I knew I had found the problem and prepared to do what was necessary to make sure the file existed or was available.

I was a bit surprised when I went to the server and found the file exactly where is was supposed to be. I assumed two things at this point.

  1. IIS 6 was configured incorrectly and not serving .CSS files due to mime type configuration.

Or

  1. There was a permissions problem on the file system.

A quick check threw 1 out the window. IIS was correctly configured to serve CSS files. I checked the permissions on the CSS file and surrounding file system structure and found that the files had correct permissions. What the heck was going on?

By accident I tried the URL to the JS file in Firefox and it downloaded! At that point I began trying my neighbors’ Internet Explorer browsers to see if they also had problems. As it turns out they did!

At this point I tested access to the same JS file on the other servers and they all worked. This prompted me to try using telnet and connecting to port 80 on the server with the problem. I manually sent the http request and data came right back. The problem seemed to be specific to this install of IIS 6 and Internet Explorer.

At this point I tried all the classics solutions, reboot my machine, the server, restart IIS. All a no-go.

Mind you, throughout this entire process I was attempting to Google for a result. Microsoft’s website alludes to a hot fix. They advise against using the hot fix to the point where you’ve actually got to call Microsoft to get it. I didn’t feel like doing that.

By a random chance I found this link to a seemingly unrelated problem: http://www.ariacom.com/forum/forums/forum.asp?forumid=12&page=0&select=54. For the heck of it I tried the provided solution and it worked!

Here’s what to do to solve the problem:

  • Open IIS Admin
  • View the properties for the website
  • Click the HTTP Headers Tab
  • Uncheck the Enable Content Expiration checkbox.

That’s all. As soon as I did that I was able to download CSS and JS files from the affected IIS 6 server. This resolved the problem I was having with the application I was working on.

Comments on: "Error: Internet Explorer Cannot Download FileName from WebServer" (69)

  1. David Jon said:

    Hi,

    I tried your fix but the "Enable Content Expiration" box was already unchecked. To resolve the problem, I had to add a new MIME type (I wanted to download an .rst file) and basically added, "rst" and set it to "TEXT" in the type box – this resolved my problem. Thank you for pointing me in the right direction though 🙂

    Like

  2. Paul Vanderveen said:

    Thank you! I had the same problem downloading a PDF with IIS 6 to IE. Unchecking the box did the trick.

    Like

  3. many thanks to David Jon. Adding a new MIME type works like a charm.

    Like

  4. Thanks for the tip. Solved our problem

    Like

  5. Sean P. O. MacCath-Moran said:

    Greetings,

    Many thanks for this artical – it helped me to get to my solution. In my case, I running Apache and serving a dynamically generated PDF file that downloads fine in all popular browsers but IE. My working solution was to add the following lines prior to my other header outputs:

    /**
    * The following Pragma and Cache-Control lines are necessary
    * as the overcome an issue that IE has in some server configurations
    * when the no-cach header is sent. The two lines override these
    * headers, allowing IE to proceed. When not turned on, the error IE
    * provides is:
    * Internet Explorer cannot download from .
    *
    * Internet Explorer was not able to open this Internet site. The requested site is either
    * unavailable or cannot be found. Please try again later.
    */
    header(“Pragma: public”);
    header(“Cache-Control: max-age=0”);

    Like

  6. Hans Eckman said:

    This solution also solves the problem or printing to thermal printers or when printing using epl2. UPS XML integration allows you to print to their Zebra Thermal printers using the epl2 format, but you get the same MIME error in IE. Here’s how to print UPS labels for .Net.
    Save the file to a folder in the site directory.
    Add EPL2 as a TEXT MIME type for the folder.
    Add to your print label page.
    Make sure your have the ActiveX plugin installed on the user machine.

    Like

  7. Thank you so much for posting this.
    It saved me a lot of trouble with not being able to download PDF files.

    Sandeep/

    Like

  8. totally mime issues! Does not matter the “mime type”, just use “TEXT”

    Like

  9. Thanks for the comment Sean P. O. MacCath-Moran!!
    You saved my day and nerves! almost detonated the ie already

    Like

  10. Robert Edlich said:

    Well, I have what appears to be the same exact issue – except I don’t have access to the servers to effect such a change. In this case I am running Vista boxes throughout my house. A few weeks back my guide updates suddenly stopped worked.

    After MANY hours tracing the issue down I found that it is downloading a TXT file from epg.tvdownload.microsoft.com (ROFL – their own servers having trouble with IE). Download fails with “internet explorer was not able to open this internet site”. FireFox downloads file no problem.

    Throwing a http sniffer up, the only difference between Firefox and IE7 seems to be some cookie variable differences. The server is sending a no-cache though. The file actually downloads to the machine and I get a HTTP OK response. So somewhere just as IE is to save the file it fails.

    For reference, here are the headers in question. IE7 header looks like this:

    FIREFOX:

    GET /epgdata/us/1/2649386701/30/89/48/28498036/28498036_ListingData.txt?clientId=7877fb90f3014a04ba294d7f14c6078d&sessionToken=40D91C41286B5C54B54403D4D7256F2705B488B12D7C7421F24D65E26097A3869B9CC09811B7E4EEFD63D5C4A53DC3801121A HTTP/1.1
    Host: epg.tvdownload.microsoft.com
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5)
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Proxy-Connection: keep-alive
    Cookie: WT_FPC=id=69.116.254.120-1359406736.29844984:lv=1180644050691:ss=1180642608230; MC1=GUID=f4e90fb96691c84aabeae866a405aaec&HASH=b90f&LV=20073&V=3; MUID=753BE55554514688998F702CF79001C3; A=I&I=AxUFAAAAAABoCAAAeARg6JFKmv230fGEDI99RQ!!&CS=100uJ400210103

    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Content-Length: 2136152
    Content-Type: text/plain
    Last-Modified: Wed, 30 May 2007 17:10:00 GMT
    Accept-Ranges: bytes
    ETag: “bdb66b5bdda2c71:239”
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    Date: Sat, 02 Jun 2007 00:12:47 GMT

    IE7 HEADER:
    GET /epgdata/us/1/2649386701/30/89/48/28498036/28498036_ListingData.txt?clientId=7877fb90f3014a04ba294d7f14c6078d&sessionToken=40D91C41286B5C54B54403D4D7256F2705B488B12D7C7421F24D65E26097A3869B9CC09811B7E4EEFD63D5C4A53DC3801121A0D5B82612FD HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
    Accept-Language: en-us
    UA-CPU: x86
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; InfoPath.2)
    Proxy-Connection: Keep-Alive
    Host: epg.tvdownload.microsoft.com
    Cookie: WT_FPC=id=69.116.254.120-3036828032.29845358:lv=1177174709063:ss=1177174645070; MC1=GUID=a20d870de37dd64d924aca43637ccca0&HASH=0d87&LV=20073&V=3; A=I&I=AxUFAAAAAACfCQAAr6QxNRJPYO9FBim39gfaqg!!

    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Content-Length: 2136152
    Content-Type: text/plain
    Last-Modified: Wed, 30 May 2007 17:10:02 GMT
    Accept-Ranges: bytes
    ETag: “97c81d5cdda2c71:239”
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    Date: Fri, 01 Jun 2007 00:56:46 GMT

    Any thoughts or suggestions greatly appreciated. What I don’t understand is why just my machines seem to be having this problem. That or nobody with Vista units are complaining loud enough they can’t get guide updates.

    Thanks,
    Robert

    Like

  11. Robert Edlich said:

    Well, I have what appears to be the same exact issue – except I don’t have access to the servers to effect such a change. In this case I am running Vista boxes throughout my house. A few weeks back my guide updates suddenly stopped worked.

    After MANY hours tracing the issue down I found that it is downloading a TXT file from epg.tvdownload.microsoft.com (ROFL – their own servers having trouble with IE). Download fails with “internet explorer was not able to open this internet site”. FireFox downloads file no problem.

    Throwing a http sniffer up, the only difference between Firefox and IE7 seems to be some cookie variable differences. The server is sending a no-cache though. The file actually downloads to the machine and I get a HTTP OK response. So somewhere just as IE is to save the file it fails.

    For reference, here are the headers in question. IE7 header looks like this:

    FIREFOX:

    GET /epgdata/us/1/2649386701/30/89/48/28498036/28498036_ListingData.txt?clientId=7877fb90f3014a04ba294d7f14c6078d&sessionToken=40D91C41286B5C54B54403D4D7256F2705B488B12D7C7421F24D65E26097A3869B9CC09811B7E4EEFD63D5C4A53DC3801121A HTTP/1.1
    Host: epg.tvdownload.microsoft.com
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5)
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Proxy-Connection: keep-alive
    Cookie: WT_FPC=id=69.116.254.120-1359406736.29844984:lv=1180644050691:ss=1180642608230; MC1=GUID=f4e90fb96691c84aabeae866a405aaec&HASH=b90f&LV=20073&V=3; MUID=753BE55554514688998F702CF79001C3; A=I&I=AxUFAAAAAABoCAAAeARg6JFKmv230fGEDI99RQ!!&CS=100uJ400210103

    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Content-Length: 2136152
    Content-Type: text/plain
    Last-Modified: Wed, 30 May 2007 17:10:00 GMT
    Accept-Ranges: bytes
    ETag: “bdb66b5bdda2c71:239”
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    Date: Sat, 02 Jun 2007 00:12:47 GMT

    IE7 HEADER:
    GET /epgdata/us/1/2649386701/30/89/48/28498036/28498036_ListingData.txt?clientId=7877fb90f3014a04ba294d7f14c6078d&sessionToken=40D91C41286B5C54B54403D4D7256F2705B488B12D7C7421F24D65E26097A3869B9CC09811B7E4EEFD63D5C4A53DC3801121A0D5B82612FD HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
    Accept-Language: en-us
    UA-CPU: x86
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; InfoPath.2)
    Proxy-Connection: Keep-Alive
    Host: epg.tvdownload.microsoft.com
    Cookie: WT_FPC=id=69.116.254.120-3036828032.29845358:lv=1177174709063:ss=1177174645070; MC1=GUID=a20d870de37dd64d924aca43637ccca0&HASH=0d87&LV=20073&V=3; A=I&I=AxUFAAAAAACfCQAAr6QxNRJPYO9FBim39gfaqg!!

    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Content-Length: 2136152
    Content-Type: text/plain
    Last-Modified: Wed, 30 May 2007 17:10:02 GMT
    Accept-Ranges: bytes
    ETag: “97c81d5cdda2c71:239”
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    Date: Fri, 01 Jun 2007 00:56:46 GMT

    Any thoughts or suggestions greatly appreciated. What I don’t understand is why just my machines seem to be having this problem. That or nobody with Vista units are complaining loud enough they can’t get guide updates.

    Thanks,
    Robert

    Like

  12. Robert Edlich said:

    Well, I have what appears to be the same exact issue – except I don’t have access to the servers to effect such a change. In this case I am running Vista boxes throughout my house. A few weeks back my guide updates suddenly stopped worked.

    After MANY hours tracing the issue down I found that it is downloading a TXT file from epg.tvdownload.microsoft.com (ROFL – their own servers having trouble with IE). Download fails with “internet explorer was not able to open this internet site”. FireFox downloads file no problem.

    Throwing a http sniffer up, the only difference between Firefox and IE7 seems to be some cookie variable differences. The server is sending a no-cache though. The file actually downloads to the machine and I get a HTTP OK response. So somewhere just as IE is to save the file it fails.

    For reference, here are the headers in question. IE7 header looks like this:

    FIREFOX:

    GET /epgdata/us/1/2649386701/30/89/48/28498036/28498036_ListingData.txt?clientId=7877fb90f3014a04ba294d7f14c6078d&sessionToken=40D91C41286B5C54B54403D4D7256F2705B488B12D7C7421F24D65E26097A3869B9CC09811B7E4EEFD63D5C4A53DC3801121A HTTP/1.1
    Host: epg.tvdownload.microsoft.com
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5)
    Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 300
    Proxy-Connection: keep-alive
    Cookie: WT_FPC=id=69.116.254.120-1359406736.29844984:lv=1180644050691:ss=1180642608230; MC1=GUID=f4e90fb96691c84aabeae866a405aaec&HASH=b90f&LV=20073&V=3; MUID=753BE55554514688998F702CF79001C3; A=I&I=AxUFAAAAAABoCAAAeARg6JFKmv230fGEDI99RQ!!&CS=100uJ400210103

    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Content-Length: 2136152
    Content-Type: text/plain
    Last-Modified: Wed, 30 May 2007 17:10:00 GMT
    Accept-Ranges: bytes
    ETag: “bdb66b5bdda2c71:239”
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    Date: Sat, 02 Jun 2007 00:12:47 GMT

    IE7 HEADER:
    GET /epgdata/us/1/2649386701/30/89/48/28498036/28498036_ListingData.txt?clientId=7877fb90f3014a04ba294d7f14c6078d&sessionToken=40D91C41286B5C54B54403D4D7256F2705B488B12D7C7421F24D65E26097A3869B9CC09811B7E4EEFD63D5C4A53DC3801121A0D5B82612FD HTTP/1.1
    Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
    Accept-Language: en-us
    UA-CPU: x86
    User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; InfoPath.2)
    Proxy-Connection: Keep-Alive
    Host: epg.tvdownload.microsoft.com
    Cookie: WT_FPC=id=69.116.254.120-3036828032.29845358:lv=1177174709063:ss=1177174645070; MC1=GUID=a20d870de37dd64d924aca43637ccca0&HASH=0d87&LV=20073&V=3; A=I&I=AxUFAAAAAACfCQAAr6QxNRJPYO9FBim39gfaqg!!

    HTTP/1.1 200 OK
    Cache-Control: no-cache
    Content-Length: 2136152
    Content-Type: text/plain
    Last-Modified: Wed, 30 May 2007 17:10:02 GMT
    Accept-Ranges: bytes
    ETag: “97c81d5cdda2c71:239”
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    Date: Fri, 01 Jun 2007 00:56:46 GMT

    Any thoughts or suggestions greatly appreciated. What I don’t understand is why just my machines seem to be having this problem. That or nobody with Vista units are complaining loud enough they can’t get guide updates.

    Thanks,
    Robert

    Like

  13. Robert Edlich said:

    GHADZUKES… The Coldfusion server here returned a SMTP error when submitting the message (had notify checked)… kept retrying post – sorry for that folks. 😦

    Like

  14. Thanks you for your comment Sean P. O. MacCath-Moran, solved my issue. =]

    Like

  15. When I am trying to open a photo on my page I get Internet Explorer can not open this page. Anyone else getting this? Something must be going on..

    Like

  16. I am having a similar problem, but the fixes noted haven’t resolved my problem. I’m trying to use an Excel app call and file download. It is working on two servers and not working on the client’s. When the page loads, a file dialog box opens and IE throws the same error everyone else is getting. (Normally, the file dialog box would open and you would choose open or save, but the error occurs before you can click anything. You see the file download box, with the error over the top of it. We’ve been trying various things and also recently got this error:

    “Microsoft Office Excel cannot access the file. here are several possible reasons: The file name or path does not exist, the file is being used by another program, the workbook you are trying to save has the same name as a currently open workbook.” None of those are actually the case.

    The client is on Windows 2000 / IIS 5 / IE 6 using Cold Fusion Server 6. Development and testing occurred on XP Pro / Cold Fusion MX 7 server and a Windows NT / Cold Fusion 5.0 server using IE 7 and Firefox.

    I have no idea how to fix it.. so any suggestions would be greatly appreciated.

    Like

  17. Thanks for the tip!! It worked for me on Server 2k3 where clients could not d/l PDFs

    Like

  18. Thanks for the tip!! It worked for me on Server 2k3 where clients could not d/l PDFs

    Like

  19. I’m also having the same issue that Robert describes, where the HTTP response for a download is fine and sends the requested file back to IE7 (I’m only having the trouble with 7), but IE throws up an error saying “Internet Explorer could not download xxx.xxx from http://www.someserver.com“. The download works fine on other broswers, even IE6.

    Also, the server is Apache on Linux, so has nothing to do with IIS, this seems to be an IE issue.

    The response headers are using Content-disposition and a application/force-download mime type to force a Save As download box.

    Any ideas anyone?

    Like

  20. Anyone knows how to force a output to get downloaded by IE7 it works every browser fine but on IE it not working.
    http://www.freearticlesarchive.com/basket/
    header(“Expires: Mon, 26 Jul 1997 05:00:00 GMT”);
    header(“Last-Modified: ” . gmdate(“D, d M Y H:i:s”) . ” GMT”);
    header(“Cache-Control: no-store, no-cache, must-revalidate”);
    header(“Cache-Control: post-check=0, pre-check=0”, false);
    header(“Pragma: no-cache”);
    header(“Content-Type: application/octet-stream” );
    header(“Content-Length: $size”);
    header(“Content-Disposition:attatchment; filename=”$filename”” );

    echo $content

    Like

  21. Michael Young said:

    I’ve experienced the same problem, and only in IE 6/7. Removal of the header “Pragma: no-cache” resolves the problem, but I’m not sure that’s what I want to do.

    This is related to http://support.microsoft.com/default.aspx?scid=kb;EN-US;q196505 in that the document is not in the cache when IE attempts to open it.

    Still looking for the ideal fix.

    Like

  22. In My case, The error message is “StartingAuthenticationFile StreamComplete StreamStartingAuthenticationFile StreamComplete Stream”.

    This is coming to the page itself when I tried to download a txt file. no download box open.

    My txt file is located on the S3 storage.

    in my html code it is just like

    But this does not works in IE. But it works great in fire fox. any Idea?

    Like

  23. Dan Herman said:

    Thank you Sean P. O. MacCath-Moran!

    Your solution of adding the following headers to my php streamed attachment worked perfectly!

    header(“Pragma: public”);
    header(“Cache-Control: max-age=0”);

    Like

  24. Ariska Keldermann said:

    I had the same problem, I wanted to open a window to a zipfile with window.open, but in Internet Explorer the file could not be downloaded, but in Firfox it could. The solution was to remove ‘no cache’ from HTTP-headers and it worked.

    Like

  25. Let me join in the many in thanking you for this solution. I had Googling for a long time before I found this post, and it fixed it right up for me. Thank you very much!

    Like

  26. Thank you for putting me on the right track to a fix.

    I had similar problems. However in my case, download would work OK for IE6 on my intranet site, but would bomb on my SSL public site. As an experiment, we tried briefly switching off SSL on the public site and the download would work.

    In my case setting an arbitrary maximum cache age of 20 minutes did the trick.

    Like

  27. hasta el pincho…muy largo

    Like

  28. I found that sending these headers fixed the problem too. It was a combination between session_start() and the headers.

    header(‘Cache-Control: maxage=3600’); //Adjust maxage appropriately
    header(‘Pragma: private’);

    Like

  29. David Chait said:

    Wow. Two years later, the comment by Sean P. O. MacCath-Moran on Sep 29, 2006 still is the solution for me… Using https, trying to just download a text file. Thanks!

    Like

  30. Thank you again Sean MacCath-Moran!

    I am also using your solution – it is the one that fixed my PDF woes

    header(“Pragma: public”);
    header(“Cache-Control: max-age=0”);

    Like

  31. 2008_04_08 said:

    PHP/IIS 6 environment,

    I had to remove $session_start()

    Like

  32. “Cache-Control: max-age=0”
    works for me too, thx

    Like

  33. Mr Nobody said:

    I ran into this problem, and none of the resolutions above worked. Turns out, the problem was related to running the reports on HTTPS, rather than HTTP.

    Like

  34. Adam Dray said:

    As far as I can tell, IE6 and IE7 have “interesting” interpretations of the cache-control directive when set no-cache or no-store. There are a number of Microsoft Knowledge Base articles about this problem but none are specific to IE7, as far as I’ve found. Many of the KB articles are misleading or even contradictory.

    The main problem is that Internet Explorer strictly interprets a combination of SSL (https) and “cache-control: no-cache” as “do not save encrypted pages to disk.”

    The “no-store” option is supposed to be a work-around, and it works for me under IE6 and fails under IE7.

    Essentially, if you want to download files to your users over SSL and turn off caching for security reasons, you’re out of luck.

    If anyone has a solution, I’d love to hear it.

    Like

  35. I am downloading a excel file from the server where I want the the dialog box for open/save will appear.My code is in C#
    I am using the code like this which is throwing the same error:
    Response.ClearContent();
    Response.Clear();
    Response.ContentType = “application/octet-stream”;
    Response.AddHeader(“Content-Disposition”, “attachment;filename=Reports.xls”);
    Response.AddHeader(“Pragma”, “public”);
    Response.AddHeader(“Cache-Control”, “max-age=0”);
    Response.Flush();
    Response.TransmitFile(“C:AuditReports.xls”);
    try
    {
    Response.End();

    }
    catch(Exception ex1)
    {
    throw ex1;
    }

    What Code should I use????

    Like

  36. Somnath said:

    The code is really Gr8

    Like

  37. Parag desai said:

    You can try using Other 15 Alternate Browsers, if problem is really with your Internet Browser or the system.

    Like

  38. Alakurd said:

    Response.ClearHeaders();

    Like

  39. Was having problem in IE over https and this your suggestion fixed it:

    header(“Pragma: public”);
    header(“Cache-Control: max-age=0”);

    Thank you! Now I can resume my life once again 😉

    Like

  40. Thanks for the hint! Working fine again 🙂

    Like

  41. Using AlphaImageLoader to fix IE6 png problem wouldn’t work over https – unchecked content-expires & all is well 🙂

    Like

  42. Steve Crooke said:

    Thanks for that, totally saved our bacon :o)

    Like

  43. I had the same problem with PDF documents being produced with CFReport (same error, but works in Firefox, etc). In my case unchecking “Enable Content Expiration” had no effect, but changing the header absolutely worked.

    In my case I could leave “Pragma” to my previous setting of “no-cache” but I had to change “Cache-control” to “max-age:0”.

    Like

  44. Sorry, my previous comment should read “max-age=0”

    Like

  45. Thank you all bodies, specially Sean P. O.

    Like

  46. Also searched my way here with a similar problem, trying to serve client a dynamic CSV file. IE7 refuses to download, even after setting “Do not save encrypted pages to disk” on/off (both cases) and with suggested headers:
    header(“Pragma: public”);
    header(“Cache-Control: max-age=0”);
    Problem appeared after moving to secure connection over HTTPS. No solution has helped yet 😦
    Webserver is Apache on Linux in this case too. Anyone still around with suggestions?

    Like

  47. guys i am realy pissed off with this issue…. and i really dont understand whats happening…
    i tried all above solutions and sadly non of them worked for me.
    the problem is either it wrks on IE6 or on IE 7 with SSL on.
    so its a catch 22.
    following are all the links i searched and tried to get a solution… but 😦 no luck yet…

    http://drupal.org/node/175716
    http://www.alagad.com/go/blog-entry/error-internet-explorer-cannot-download-filename-from-webserver
    http://us2.php.net/manual/en/function.header.php#83219
    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1350230&SiteID=1
    http://support.microsoft.com/kb/316431/
    http://support.microsoft.com/kb/815313/
    http://support.microsoft.com/kb/812935/
    http://support.microsoft.com/kb/323308/

    is there anybody in this very world who will come to rescue.
    F1 F1 F1.. 🙂

    Like

  48. After spending the $259 or what have you, we finally managed to figure out what our problem was: The internet cache location was incorrect.

    Scenario:
    OS: Windows 2000 Server
    Browser: IE6 SP1 with latest patches (as of 12/28/08)
    Error: Internet Explorer Cannot Download FileName from WebServer

    In my situation the error had nothing to do with the headers being sent from our server but rather a malformed registry key. This post was the most invaluable so I’m adding my notes here:

    Open up regedit and browse to: HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders

    Check the ‘Cache’ setting, if it has ‘%SystemRoot%’ anywhere in its settings you found your problem.

    Create a logon script called ‘FixCache.bat’ and paste the following:
    regedit.exe UserShellFolders.reg

    Create a UserShellFolders.reg file and paste the following into it:
    Windows Registry Editor Version 5.00

    [HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders]
    “Cache”=hex(2):25,00,55,00,53,00,45,00,52,00,50,00,52,00,4f,00,46,00,49,00,4c, 00,45,00,25,00,5c,00,4c,00,6f,00,63,00,61,00,6c,00,20,00,53,00,65,00,74,00, 74,00,69,00,6e,00,67,00,73,00,5c,00,54,00,65,00,6d,00,70,00,6f,00,72,00,61, 00,72,00,79,00,20,00,49,00,6e,00,74,00,65,00,72,00,6e,00,65,00,74,00,20,00, 46,00,69,00,6c,00,65,00,73,00,00,00

    Make sure the registry file and bat file are in the same directory and run the .bat file. It will ask you if you want to install the registry key. Say yes and bingo! You’re fixed. You can also roll this out as a Group Policy Object and use ‘regedit.exe /s’ to silently install the key.

    Hopefully this will save someone the time and energy I’ve burnt on this. Good Luck and God Speed!

    Like

  49. hi,
    I am facing same problem
    “Error: Internet Explorer Cannot download FileName from WebServer” Even after Unchecking the Enable Content Expiration checkbox. Please help

    Like

  50. Had same problem on IIS 7/Win 2008. Working fine on local Vista dev box. Moved to server and could not download. I had this in my page load event, Response.Cache.SetCacheability(HttpCacheability.NoCache). Removed it and works fine in IIS7/Win2008 install.

    Like

  51. HikingStick said:

    More of the same, but different enough to post.

    We have a Win2k3 box with IIS6 running. It has Web Folders configured and directed via NAT to a public IP address.

    We loaded an 80 Mb file to the pickup location and the customer connected, but he received the error “Internet Explorer cannot download FILENAME from SERVERNAME”. The site is currently configured for http-only transfers (no https/SSL). The file type is a STEP file, so I added a MIME type for the file, but that did not clear it up.

    To further test things, if I place a RTF in the folder, both I and our remote user can download it immediately. The file can be downloaded while using FireFox, but our customer’s IT department does not want to give him another browser.

    Any ideas? I’m relatively new to managing IIS.

    Thanks,

    ~HikingStick

    Like

  52. I am facing issue (Internet Explorer Cannot Download FileName from WebServer) while downloading Excel or txt file for HTTPS IE
    I am using below code in C#

    Response.ContentType = “application/x-excel”;
    Response.AddHeader(“content-disposition”, “attachment; filename=” + filename + “.xls”);
    Response.AddHeader(“Pragma”, “public”);
    Response.AddHeader(“Cache-Control”, “max-age=0”);

    Please help me to resolve this issue

    Like

  53. I had the issue in IE6/7/8; Fine in FireFox.

    Added this

    Response.AppendHeader(“Pragma”, “public”);
    Response.AppendHeader(“Cache-Control”, “max-age=0”);

    Response.AppendHeader(“Content-Type”, iDoc.FileContentType);// “application/msword”
    Response.AppendHeader(“Content-disposition”, “attachment; filename=” + iDoc.FileName);
    Response.Charset = “”;

    But also removed this from the rendering web page.

    !— Deleted —

    Note that in the web.Config the cache settings can also be set so you may need to check those as well.

    What a WOT..

    Like

  54. geomannl said:

    Couldn’t download a file; cause/fix was: de filename that I inserted into the excel-command

    Response.AddHeader(“Content-Disposition”, “attachment;filename=” & p_strFilename & “.xls”)

    contained a ‘-‘, and that was probably interpreted as a command separation or something by IE. Changing the filename solved the download problem.

    Like

  55. http://support.microsoft.com/?kbid=317208

    This article fixed this for us, after we set content expiration to 10 mins instead of immeadiately, as we had it set before. Also, note that this article refers to this fix being for IIS 5.1 and IE 6, however we had this issue with IIS 6 and IE 6, 7, and 8, so it could also affect IIS 7 (Svr 2008) and IIS 7.5 (Svr 2008 R2). I have opened a case with MS to get the article updated as a matter of urgency, and as I feel it is my duty to fellow IT Pro’s in the industry

    Like

  56. Update: The knowledge base article above has now been updated by MS based on my proof of concept and them replicating the issue with newer versions of IE and IIS. Enjoy!

    Like

  57. Wow. *Three* years later and Sean P. O. MacCath-Moran’s comment on Sep 29, 2006 is *still* helping people cope with IE’s stoopidity.

    I’m using LAMP to generate a PDF over https. And dontcha know, IE 7 won’t let the PDF file download. So I replaced my Pragma: no-cache header in the PDF generation script with these per Sean’s suggestion:

    header(“Pragma: public”);
    header(“Cache-Control: max-age=0”);

    And voila! Success!

    Thanks Sean, where ever you are… you rocked.

    Like

  58. PHyO4d ucdzmiytaqne, [url=http://wsifnbkvewwp.com/]wsifnbkvewwp[/url], [link=http://lqyirdcwgdcc.com/]lqyirdcwgdcc[/link], http://tsbbyumzzpdh.com/

    Like

  59. Never has this issue in Firefox, only in IE. But this worked for both browsers.

    Respose.ClearHeaders();
    Response.ClearContent();
    Response.Clear();
    Response.ContentType = “image/jpeg”;
    Response.AddHeader(“Content-Disposition”, “attachment;filename=Reports.jpeg”);
    Response.AddHeader(“Pragma”, “public”);
    Response.AddHeader(“Cache-Control”, “max-age=0”);
    Response.Flush();
    Response.TransmitFile(“C:Reports.jpeg”);
    try
    {
    Response.End();

    }
    catch(Exception ex1)
    {
    throw ex1;
    }

    Like

  60. I have just been cursing this issue all afternoon (IE8, ColdFusion and Apache) and I can now go into the weekend one happy developer.

    Sean P. O. MacCath-Moran I thank you.

    Like

  61. This is a documented Internet Explorer issue.

    See:
    http://support.microsoft.com/kb/323308

    IE has had this problem since version 5.1, and there are work-arounds for all versions since – up to 8. (see link)

    I would NOT recommend changing the cache-control for your servers to fix this unless you understand the effect it could have on the rest of your site.

    hth,
    T

    Like

  62. Juan Burbano said:

    Thank you all. For SSL with IE it works well:
    response.setHeader ( “Pragma”, “public”); response.setHeader ( “Content-Cache”, “max-age=0”);
    response.setContentType(“application/text”);

    Dont’use response.addHeader().
    Use response.setHeader().

    Like

  63. Thanks very much for this useful comments they have pointed me in the right direction to solve my issue!

    Like

  64. I used the following blog “I had the same problem, I wanted to open a window to a zipfile with window.open, but in Internet Explorer the file could not be downloaded, but in Firfox it could. The solution was to remove ‘no cache’ from HTTP-headers and it worked.”

    and It work for me.. thanks a million

    Like

  65. Thanks for this post…. I got it working for IE with the first line.

    public void WriteCSV(string strData) {
    //Required for IIs7 WS2008R2 fix
    Response.ClearHeaders();
    Response.Clear();

    Response.Buffer = true;
    Response.ContentType = “application/csv”;
    Response.AddHeader(“Content-Disposition”, “attachment;filename=report.csv”);
    Response.Write(strData);
    Response.Flush();
    Response.End();
    }

    Like

  66. I am able to download files internally ( Local Area Network).Thanks for the article.

    Like

  67. Is there any option/article where i can be able to download files from my local pc(through Ftp ) via internet.Your suggestions will be really helpful.

    Like

  68. ISP…

    Error: Internet Explorer Cannot Download FileName from WebServer – Alagad Ally…

    Like

  69. Hot File Hosting…

    […]Error: Internet Explorer Cannot Download FileName from WebServer – Alagad Ally[…]…

    Like

Comments are closed.

Tag Cloud