Commit 3c19b8019941a41eed80f605b096c8640f8781ae
1 parent
a2ffc9b7
KTS-1333
"Problem downloading files with accented characters" Fixed. Filename is now urlencoded. Reviewed By: Jalaloedien git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@6197 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
7 additions
and
1 deletions
lib/storage/ondiskhashedstoragemanager.inc.php
| @@ -142,10 +142,16 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { | @@ -142,10 +142,16 @@ class KTOnDiskHashedStorageManager extends KTStorageManager { | ||
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | if (file_exists($sPath)) { | 144 | if (file_exists($sPath)) { |
| 145 | + | ||
| 146 | + $oUrlEncodedFileName = $oDocument->getFileName( ); | ||
| 147 | + $browser = $_SERVER['HTTP_USER_AGENT']; | ||
| 148 | + if ( strpos( strtoupper( $browser), 'MSIE') !== false) { | ||
| 149 | + $oUrlEncodedFileName = rawurlencode( $oUrlEncodedFileName); | ||
| 150 | + } | ||
| 145 | //set the correct headers | 151 | //set the correct headers |
| 146 | header("Content-Type: " . $mimetype); | 152 | header("Content-Type: " . $mimetype); |
| 147 | header("Content-Length: ". $oDocument->getFileSize()); | 153 | header("Content-Length: ". $oDocument->getFileSize()); |
| 148 | - header("Content-Disposition: attachment; filename=\"" . $oDocument->getFileName() . "\""); | 154 | + header("Content-Disposition: attachment; filename=\"" . $oUrlEncodedFileName . "\""); |
| 149 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); | 155 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
| 150 | header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); | 156 | header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
| 151 | header("Cache-Control: must-revalidate"); | 157 | header("Cache-Control: must-revalidate"); |