summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2015-03-26 16:24:15 +0100
committerAndreas Fischer <bantu@owncloud.com>2015-04-04 11:53:19 +0200
commit94ada409bbc9a0151a952b89bcfdebe32ba6c105 (patch)
tree55387ff7296b765b348d6297b4b5504daf293a68 /apps/files
parent8357a253b3f4a23d026a7fdb467a24154f7a70b0 (diff)
downloadnextcloud-server-94ada409bbc9a0151a952b89bcfdebe32ba6c105.tar.gz
nextcloud-server-94ada409bbc9a0151a952b89bcfdebe32ba6c105.zip
Add OC_Response::setContentLengthHeader() for Apache PHP SAPI workaround.
Do not send Content-Length headers with a value larger than PHP_INT_MAX (2147483647) on Apache PHP SAPI 32-bit. PHP will eat them and send 2147483647 instead. When X-Sendfile is enabled, Apache will send a correct Content-Length header, even for files larger than 2147483647 bytes. When X-Sendfile is not enabled, ownCloud will not send a Content-Length header. This prevents progress bars from working, but allows the actual transfer to work properly.
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/download.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/files/download.php b/apps/files/download.php
index 664a69c5959..8d9c539284f 100644
--- a/apps/files/download.php
+++ b/apps/files/download.php
@@ -39,7 +39,7 @@ $ftype=\OC_Helper::getSecureMimeType(\OC\Files\Filesystem::getMimeType( $filenam
header('Content-Type:'.$ftype);
OCP\Response::setContentDispositionHeader(basename($filename), 'attachment');
OCP\Response::disableCaching();
-header('Content-Length: '.\OC\Files\Filesystem::filesize($filename));
+OCP\Response::setContentLengthHeader(\OC\Files\Filesystem::filesize($filename));
OC_Util::obEnd();
\OC\Files\Filesystem::readfile( $filename );