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

Commit

Permalink
Add the filename*= header for IE, based on mwehr suggestion. To be te…
Browse files Browse the repository at this point in the history
…sted extensively.
  • Loading branch information
cdujeu committed Oct 24, 2015
1 parent 9fecbc6 commit 901b8d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/src/core/classes/class.HTMLWriter.php
Expand Up @@ -174,7 +174,7 @@ public static function generateAttachmentsHeader(&$attachmentName, $dataSize, $i
if ($isFile && ($dataSize != 0)) {
header("Content-Range: bytes 0-" . ($dataSize- 1) . "/" . $dataSize . ";");
}
header("Content-Disposition: attachment; filename=\"".$attachmentName."\"");
header('Content-Disposition: attachment; filename="' . $attachmentName . '"; filename*=utf-8\' \'' . rawurlencode($attachmentName));
header("Expires: 0");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
Expand Down
6 changes: 4 additions & 2 deletions core/src/plugins/access.fs/class.fsAccessDriver.php
Expand Up @@ -1472,7 +1472,8 @@ public function readFile($filePathOrData, $headerType="plain", $localName="", $d
$header_sendfile = "X-Sendfile";
header($header_sendfile.": ".SystemTextEncoding::toUTF8($filePathOrData));
header("Content-type: application/octet-stream");
header('Content-Disposition: attachment; filename="' . basename($filePathOrData) . '"');
$filename = basename($filePathOrData);
header('Content-Disposition: attachment; filename="' . $filename . '"; filename*=utf-8\' \'' . rawurlencode($filename));
return;
}
if ($this->getFilteredOption("USE_XACCELREDIRECT", $this->repository->getId()) && AJXP_MetaStreamWrapper::actualRepositoryWrapperClass($this->repository->getId()) == "fsAccessWrapper" && array_key_exists("X-Accel-Mapping",$_SERVER)) {
Expand All @@ -1485,7 +1486,8 @@ public function readFile($filePathOrData, $headerType="plain", $localName="", $d
if ($replacecount == 1) {
header("X-Accel-Redirect: $accelfile");
header("Content-type: application/octet-stream");
header('Content-Disposition: attachment; filename="' . basename($accelfile) . '"');
$filename = basename($accelfile);
header('Content-Disposition: attachment; filename="' . $filename . '"; filename*=utf-8\' \'' . rawurlencode($filename));
return;
} else {
$this->logError("X-Accel-Redirect","Problem with X-Accel-Mapping for file $filePathOrData");
Expand Down

0 comments on commit 901b8d2

Please sign in to comment.