summaryrefslogtreecommitdiffstats
path: root/lib/filesystemview.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/filesystemview.php')
-rw-r--r--lib/filesystemview.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/filesystemview.php b/lib/filesystemview.php
index 39e47975b28..a3736f1976c 100644
--- a/lib/filesystemview.php
+++ b/lib/filesystemview.php
@@ -137,13 +137,16 @@ class OC_FilesystemView {
}
public function readfile($path){
$handle=$this->fopen($path,'r');
- $chunkSize = 1024*1024;// 1 MB chunks
- while (!feof($handle)) {
- echo fread($handle, $chunkSize);
- @ob_flush();
- flush();
+ if ($handle) {
+ $chunkSize = 1024*1024;// 1 MB chunks
+ while (!feof($handle)) {
+ echo fread($handle, $chunkSize);
+ @ob_flush();
+ flush();
+ }
+ return $this->filesize($path);
}
- return $this->filesize($path);
+ return false;
}
public function is_readable($path){
return $this->basicOperation('is_readable',$path);