diff options
author | Andreas Fischer <bantu@owncloud.com> | 2015-03-26 16:24:15 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2015-03-26 16:37:38 +0100 |
commit | 0f58315543a6f3b87d4376cea493c13645687bc2 (patch) | |
tree | f273acf222a799270a614ae2eab28f2a148f6b9e /apps | |
parent | 0d786c381b8d4656e6bbcb5ef2b33e718ea639eb (diff) | |
download | nextcloud-server-0f58315543a6f3b87d4376cea493c13645687bc2.tar.gz nextcloud-server-0f58315543a6f3b87d4376cea493c13645687bc2.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')
-rw-r--r-- | apps/files/download.php | 2 | ||||
-rw-r--r-- | apps/files_versions/download.php | 2 |
2 files changed, 2 insertions, 2 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 ); diff --git a/apps/files_versions/download.php b/apps/files_versions/download.php index e5139450f5e..c63fde51954 100644 --- a/apps/files_versions/download.php +++ b/apps/files_versions/download.php @@ -38,7 +38,7 @@ $ftype = $view->getMimeType('/'.$uid.'/files/'.$filename); header('Content-Type:'.$ftype); OCP\Response::setContentDispositionHeader(basename($filename), 'attachment'); OCP\Response::disableCaching(); -header('Content-Length: '.$view->filesize($versionName)); +OCP\Response::setContentLengthHeader($view->filesize($versionName)); OC_Util::obEnd(); |