From 0f58315543a6f3b87d4376cea493c13645687bc2 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 26 Mar 2015 16:24:15 +0100 Subject: 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. --- lib/public/response.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/public/response.php') diff --git a/lib/public/response.php b/lib/public/response.php index 24d3c81d628..c32eb4a05e0 100644 --- a/lib/public/response.php +++ b/lib/public/response.php @@ -63,6 +63,14 @@ class Response { \OC_Response::setContentDispositionHeader( $filename, $type ); } + /** + * Sets the content length header (with possible workarounds) + * @param string|int|float $length Length to be sent + */ + static public function setContentLengthHeader($length) { + \OC_Response::setContentLengthHeader($length); + } + /** * Disable browser caching * @see enableCaching with cache_time = 0 -- cgit v1.2.3