Microsoft KB Archive/279667

= FIX: Content-Disposition Attachment Header Does Not Save File =

Article ID: 279667

Article Last Modified on 5/3/2007

-

APPLIES TO


 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q279667



SYMPTOMS
A Web server that uses the Content-disposition: attachment HTTP header to force a file download should prompt the user to open or save the file; however, in Internet Explorer 5.5 Service Pack 1 (SP1), the user is prompted to open or save the HTML file instead.



RESOLUTION
To resolve this problem, refer to the hotfix that is described in the following Microsoft Knowledge Base article:

281119 Internet Explorer Saves HTML Content Instead of the Active Document

In addition, a fix for this problem is incorporated in Microsoft security bulletin MS01-015:

http://www.microsoft.com/technet/security/bulletin/MS01-015.mspx

WORKAROUND
There are several ways to work around this problem:
 * Bypass Content-disposition, and use either an ActiveX control or a Java applet to download files to disk.
 * Use the Save As command from the pop-up menu.
 * Use the Internet Explorer download behavior instead. (This is for text-based files only).
 * Use a window.showModalDialog of an HTML page that does a document.write of a hidden IFRAME with the source pointing to the file.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
  Create an HTML Page with an anchor tag that points to the file:   Click here to download file    Add the HTML Response Headers for the file by using your Web Server software:

Content-Type = application/download

Content-Disposition = attachment; filename=test.txt

 In Internet Explorer 5.5 SP1, navigate to this new page.</li> Click the hyperlink to the file.</li></ol>

<div class="references_section">