Check file handle exists before trying to read file
This commit is contained in:
parent
daf742c086
commit
6bb48b2731
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue