aboutsummaryrefslogtreecommitdiffstats
path: root/lib/files.php
diff options
context:
space:
mode:
authorGeorg Ehrke <dev@georgswebsite.de>2012-04-15 22:28:11 +0200
committerGeorg Ehrke <dev@georgswebsite.de>2012-04-15 22:28:11 +0200
commit77cefdedb86de65e69f470c8b6a1b03bb001966e (patch)
tree547b3a111c4d07992b7c528f2db4962ee36f91f9 /lib/files.php
parent77a9e343aae4fc19a1e6fbf71b73e171640ac02a (diff)
parent12818093007d5bdce5519b5015e2a0748c98e24d (diff)
downloadnextcloud-server-77cefdedb86de65e69f470c8b6a1b03bb001966e.tar.gz
nextcloud-server-77cefdedb86de65e69f470c8b6a1b03bb001966e.zip
Merge branch 'master' into sabredav_1.6
Diffstat (limited to 'lib/files.php')
-rw-r--r--lib/files.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/files.php b/lib/files.php
index 051cfd4b81c..a7b83149574 100644
--- a/lib/files.php
+++ b/lib/files.php
@@ -63,7 +63,7 @@ class OC_Files {
$executionTime = intval(ini_get('max_execution_time'));
set_time_limit(0);
$zip = new ZipArchive();
- $filename = get_temp_dir().'/ownCloud_'.mt_rand(10000,99999).'.zip';
+ $filename = OC_Helper::tmpFile('.zip');
if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==TRUE) {
exit("cannot open <$filename>\n");
}
@@ -84,7 +84,7 @@ class OC_Files {
$executionTime = intval(ini_get('max_execution_time'));
set_time_limit(0);
$zip = new ZipArchive();
- $filename = get_temp_dir().'/ownCloud_'.mt_rand(10000,99999).'.zip';
+ $filename = OC_Helper::tmpFile('.zip');
if ($zip->open($filename, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE)!==TRUE) {
exit("cannot open <$filename>\n");
}
@@ -104,15 +104,15 @@ class OC_Files {
header('Content-Type: application/zip');
header('Content-Length: ' . filesize($filename));
}else{
- header('Content-Type: ' . OC_Filesystem::getMimeType($filename));
- header('Content-Length: ' . OC_Filesystem::filesize($filename));
+ $fileData=OC_FileCache::get($filename);
+ header('Content-Type: ' . $fileData['mimetype']);
+ header('Content-Length: ' . $fileData['size']);
}
}elseif($zip or !OC_Filesystem::file_exists($filename)){
header("HTTP/1.0 404 Not Found");
$tmpl = new OC_Template( '', '404', 'guest' );
$tmpl->assign('file',$filename);
$tmpl->printPage();
-// die('404 Not Found');
}else{
header("HTTP/1.0 403 Forbidden");
die('403 Forbidden');
@@ -225,7 +225,7 @@ class OC_Files {
*/
static function validateZipDownload($dir, $files) {
if(!OC_Config::getValue('allowZipDownload', true)) {
- $l = new OC_L10N('files');
+ $l = OC_L10N::get('files');
header("HTTP/1.0 409 Conflict");
$tmpl = new OC_Template( '', 'error', 'user' );
$errors = array(
@@ -250,7 +250,7 @@ class OC_Files {
$totalsize += OC_Filesystem::filesize($dir.'/'.$files);
}
if($totalsize > $zipLimit) {
- $l = new OC_L10N('files');
+ $l = OC_L10N::get('files');
header("HTTP/1.0 409 Conflict");
$tmpl = new OC_Template( '', 'error', 'user' );
$errors = array(