Check file handle exists before trying to read file
This commit is contained in:
parent
daf742c086
commit
6bb48b2731
|
@ -137,6 +137,7 @@ class OC_FilesystemView {
|
|||
}
|
||||
public function readfile($path){
|
||||
$handle=$this->fopen($path,'r');
|
||||
if ($handle) {
|
||||
$chunkSize = 1024*1024;// 1 MB chunks
|
||||
while (!feof($handle)) {
|
||||
echo fread($handle, $chunkSize);
|
||||
|
@ -145,6 +146,8 @@ class OC_FilesystemView {
|
|||
}
|
||||
return $this->filesize($path);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function is_readable($path){
|
||||
return $this->basicOperation('is_readable',$path);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue