]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixed download of complete publically shared folder
authorBjörn Schießle <schiessle@owncloud.com>
Fri, 5 Oct 2012 09:38:00 +0000 (11:38 +0200)
committerBjörn Schießle <schiessle@owncloud.com>
Fri, 5 Oct 2012 09:38:00 +0000 (11:38 +0200)
apps/files_sharing/public.php

index aa074e629daab59a7cbe57eb15590afe8576953a..2d6437d819f61da042fe2e7056a11407c08849e4 100644 (file)
@@ -82,14 +82,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
                        }
                        // Download the file
                        if (isset($_GET['download'])) {
-                               $mimetype = OC_Filesystem::getMimeType($path);
-                               header('Content-Transfer-Encoding: binary');
-                               header('Content-Disposition: attachment; filename="'.basename($path).'"');
-                               header('Content-Type: '.$mimetype);
-                               header('Content-Length: '.OC_Filesystem::filesize($path));
-                               OCP\Response::disableCaching();
-                               @ob_clean();
-                               OC_Filesystem::readfile($path);
+                               OC_Files::get($path, '', $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
                        } else {
                                OCP\Util::addStyle('files_sharing', 'public');
                                OCP\Util::addScript('files_sharing', 'public');