diff options
author | Brice Maron <brice@bmaron.net> | 2012-05-24 22:48:10 +0000 |
---|---|---|
committer | Brice Maron <brice@bmaron.net> | 2012-05-24 22:48:10 +0000 |
commit | 9c2a6fb551487dad29cd327a5f357f2ac28e8edd (patch) | |
tree | a0d3409723a754b31baaad7145f875b7de1544a2 /lib/files.php | |
parent | 5fa14806c8e638143c1b67eb9dc532b255f23bd7 (diff) | |
download | nextcloud-server-9c2a6fb551487dad29cd327a5f357f2ac28e8edd.tar.gz nextcloud-server-9c2a6fb551487dad29cd327a5f357f2ac28e8edd.zip |
Add HEAD request management for files ajax/download.php
Diffstat (limited to 'lib/files.php')
-rw-r--r-- | lib/files.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/files.php b/lib/files.php index b405cf1749f..e0c78d22c24 100644 --- a/lib/files.php +++ b/lib/files.php @@ -52,8 +52,9 @@ class OC_Files { * * @param dir $dir * @param file $file ; seperated list of files to download + * @param boolean $only_header ; boolean to only send header of the request */ - public static function get($dir,$files){ + public static function get($dir,$files, $only_header = false){ if(strpos($files,';')){ $files=explode(';',$files); } @@ -118,6 +119,11 @@ class OC_Files { header("HTTP/1.0 403 Forbidden"); die('403 Forbidden'); } + if($only_header){ + if(!$zip) + header("Content-Length: ".OC_Filesystem::filesize($filename)); + return ; + } if($zip){ $handle=fopen($filename,'r'); if ($handle) { |