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. --- apps/files_versions/download.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/files_versions/download.php') 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(); -- cgit v1.2.3