[php:LocalFileSystem] check result of the file saveing

May be solved #891.
This commit is contained in:
nao-pon
2014-11-22 18:37:02 +09:00
parent 779244ce4f
commit 858ef69792
+1 -5
View File
@@ -538,14 +538,10 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
protected function _save($fp, $dir, $name, $stat) {
$path = $dir.DIRECTORY_SEPARATOR.$name;
if (!($target = @fopen($path, 'wb'))) {
if (@file_put_contents($path, $fp, LOCK_EX) === false) {
return false;
}
while (!feof($fp)) {
fwrite($target, fread($fp, 8192));
}
fclose($target);
@chmod($path, $this->options['fileMode']);
clearstatcache();
return $path;