Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 901b8d2

Browse files
committed
Add the filename*= header for IE, based on mwehr suggestion. To be tested extensively.
1 parent 9fecbc6 commit 901b8d2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/src/core/classes/class.HTMLWriter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public static function generateAttachmentsHeader(&$attachmentName, $dataSize, $i
174174
if ($isFile && ($dataSize != 0)) {
175175
header("Content-Range: bytes 0-" . ($dataSize- 1) . "/" . $dataSize . ";");
176176
}
177-
header("Content-Disposition: attachment; filename=\"".$attachmentName."\"");
177+
header('Content-Disposition: attachment; filename="' . $attachmentName . '"; filename*=utf-8\' \'' . rawurlencode($attachmentName));
178178
header("Expires: 0");
179179
header("Cache-Control: no-cache, must-revalidate");
180180
header("Pragma: no-cache");

core/src/plugins/access.fs/class.fsAccessDriver.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,8 @@ public function readFile($filePathOrData, $headerType="plain", $localName="", $d
14721472
$header_sendfile = "X-Sendfile";
14731473
header($header_sendfile.": ".SystemTextEncoding::toUTF8($filePathOrData));
14741474
header("Content-type: application/octet-stream");
1475-
header('Content-Disposition: attachment; filename="' . basename($filePathOrData) . '"');
1475+
$filename = basename($filePathOrData);
1476+
header('Content-Disposition: attachment; filename="' . $filename . '"; filename*=utf-8\' \'' . rawurlencode($filename));
14761477
return;
14771478
}
14781479
if ($this->getFilteredOption("USE_XACCELREDIRECT", $this->repository->getId()) && AJXP_MetaStreamWrapper::actualRepositoryWrapperClass($this->repository->getId()) == "fsAccessWrapper" && array_key_exists("X-Accel-Mapping",$_SERVER)) {
@@ -1485,7 +1486,8 @@ public function readFile($filePathOrData, $headerType="plain", $localName="", $d
14851486
if ($replacecount == 1) {
14861487
header("X-Accel-Redirect: $accelfile");
14871488
header("Content-type: application/octet-stream");
1488-
header('Content-Disposition: attachment; filename="' . basename($accelfile) . '"');
1489+
$filename = basename($accelfile);
1490+
header('Content-Disposition: attachment; filename="' . $filename . '"; filename*=utf-8\' \'' . rawurlencode($filename));
14891491
return;
14901492
} else {
14911493
$this->logError("X-Accel-Redirect","Problem with X-Accel-Mapping for file $filePathOrData");

0 commit comments

Comments
 (0)