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

Commit

Permalink
Fix to #1100 - use AJXP_MetaStreamWrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ghecquet committed Mar 22, 2016
1 parent 44393b0 commit 7d3bc33
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/plugins/access.fs/class.fsAccessDriver.php
Expand Up @@ -1477,14 +1477,16 @@ public function readFile($filePathOrData, $headerType="plain", $localName="", $d
print($filePathOrData);
} else {
if ($this->getFilteredOption("USE_XSENDFILE", $this->repository) && AJXP_MetaStreamWrapper::actualRepositoryWrapperClass($this->repository->getId()) == "fsAccessWrapper") {
if(!$realfileSystem) $filePathOrData = fsAccessWrapper::getRealFSReference($filePathOrData);
if(!$realfileSystem) $filePathOrData = AJXP_MetaStreamWrapper::getRealFSReference($filePathOrData);
$filePathOrData = str_replace("\\", "/", $filePathOrData);
$server_name = $_SERVER["SERVER_SOFTWARE"];
$regex = '/^(lighttpd\/1.4).([0-9]{2}$|[0-9]{3}$|[0-9]{4}$)+/';
if(preg_match($regex, $server_name))
$header_sendfile = "X-LIGHTTPD-send-file";
else
$header_sendfile = "X-Sendfile";


header($header_sendfile.": ".SystemTextEncoding::toUTF8($filePathOrData));
header("Content-type: application/octet-stream");
header('Content-Disposition: attachment; filename="' . basename($filePathOrData) . '"');
Expand Down

0 comments on commit 7d3bc33

Please sign in to comment.