View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011082 | mantisbt | attachments | public | 2009-10-26 11:38 | 2010-04-23 23:22 |
Reporter | frodgers | Assigned To | dhx | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | duplicate | ||
Product Version | 1.2.0rc2 | ||||
Summary | 0011082: Unable to download attached file with Internet Explorer 7 & 8 | ||||
Description | When an attached file link is clicked IE presents the download file dialog box with the file name being "file_download.htm" rather than the name of the actual file. This link will work correctly when clicked on with Firefox 3.5. | ||||
Additional Information | I was able to correct this problem by checking $_SERVER["HTTP_USER_AGENT"] and using a different header for IE and Firefox. Firefox would not work correctly with the header needed for IE. I've included the patch I used for my site. This should probably be expanded to include other Browsers. | ||||
Tags | patch | ||||
Attached Files | file_download.patch (1,180 bytes)
From d0b139e00de70581ddacb8680ecbb9e18a1c2292 Mon Sep 17 00:00:00 2001 From: Frank Rodgers <frodgers@redcom.com> Date: Mon, 26 Oct 2009 10:39:54 -0400 Subject: [PATCH] See TR12247, unable to download file from Internet Explorer diff --git a/file_download.php b/file_download.php index 8e6ec23..1ea41bb 100644 --- a/file_download.php +++ b/file_download.php @@ -105,7 +105,12 @@ # The following header has undefined behaviour but needs to be used to # allow a fallback for old browsers that don't support RFC2231. # See http://greenbytes.de/tech/tc2231/ for more information. - header( 'Content-Disposition:' . $t_disposition . ' filename*=UTF-8\'\'' . urlencode( $t_filename ) . '; filename="' . urlencode( $t_filename ) . '"' ); + + if( !strpos($_SERVER["HTTP_USER_AGENT"], 'MSIE' ) === false ){ + header( 'Content-Disposition:' . $t_disposition . '; filename="' . urlencode( $t_filename ) . '"' ); + } else { + header( 'Content-Disposition:' . $t_disposition . ' filename*=UTF-8\'\'' . urlencode( $t_filename ) . '; filename="' . urlencode( $t_filename ) . '"' ); + } header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s \G\M\T', $v_date_added ) ); -- 1.6.0.4 | ||||
Yep it's the same thing, marked as a duplicate. Thanks! frodgers: this has been fixed in 0011075 :) |
|
Thank you, sorry for the duplicate. |
|
Thank you guys. The patch works great on IE and FF. |
|
Similar Problem with 1.2.0rc2, but the IE wants to download "file_download.php". This patch or the patch of issue 0011075 doesn't work (same problem). |
|
@MJ: yeah 1.2.0rc2 exhibits this issue. In the 1.2.x branch (current development on the "1.2" series), this issue has been fixed - hence labeling this report as a duplicate of 0011075 |
|