Skip to content

Commit

Permalink
[volume:ftp] use ftp_fget() in _fopen() for stream processing
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Jan 23, 2015
1 parent 47d1cf0 commit 2494ffd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions php/elFinderVolumeFTP.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -692,10 +692,12 @@ protected function _fopen($path, $mode='rb') {
if ($this->tmp) {
$local = $this->tmp.DIRECTORY_SEPARATOR.md5($path);
if (ftp_get($this->connect, $local, $path, FTP_BINARY)) {
return @fopen($local, $mode);
$fp = @fopen($local, $mode);
if (ftp_fget($this->connect, $fp, $path, FTP_BINARY)) {
return $fp;
}
@fclose($fp);
is_file($local) && @unlink($local);
}
return false;
Expand Down

0 comments on commit 2494ffd

Please sign in to comment.