View Issue Details

IDProjectCategoryView StatusLast Update
0011082mantisbtattachmentspublic2010-04-23 23:22
Reporterfrodgers Assigned Todhx  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionduplicate 
Product Version1.2.0rc2 
Summary0011082: 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.

Tagspatch
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

file_download.patch (1,180 bytes)   

Relationships

duplicate of 0011075 closeddhx File downloading - IE vs non-IE filename bugs 

Activities

vboctor

vboctor

2009-10-27 03:33

manager   ~0023385

Last edited: 2009-10-27 03:33

@dhx, is this related to 0011075?

dhx

dhx

2009-10-27 03:37

reporter   ~0023386

Yep it's the same thing, marked as a duplicate. Thanks!

frodgers: this has been fixed in 0011075 :)

frodgers

frodgers

2009-10-27 07:52

reporter   ~0023406

Thank you, sorry for the duplicate.

xyz123

xyz123

2009-11-01 18:54

reporter   ~0023529

Thank you guys. The patch works great on IE and FF.

MJ

MJ

2009-11-03 02:44

reporter   ~0023551

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).

yw84ever

yw84ever

2009-11-19 12:50

reporter   ~0023762

@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