ftp_base::put()
Метод класса: ftp_base{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
$ftp_base = new ftp_base(); $ftp_base->put( $localfile, $remotefile, $rest );
- $localfile (обязательный)
- -
- $remotefile **
- -
По умолчанию: NULL - $rest **
- -
Код ftp_base::put() ftp base::put WP 6.6.1
function put($localfile, $remotefile=NULL, $rest=0) { if(is_null($remotefile)) $remotefile=$localfile; if (!file_exists($localfile)) { $this->PushError("put","cannot open local file", "No such file or directory \"".$localfile."\""); return FALSE; } $fp = @fopen($localfile, "r"); if (!$fp) { $this->PushError("put","cannot open local file", "Cannot read file \"".$localfile."\""); return FALSE; } if($this->_can_restore and $rest!=0) fseek($fp, $rest); $pi=pathinfo($localfile); if($this->_type==FTP_ASCII or ($this->_type==FTP_AUTOASCII and in_array(strtoupper($pi["extension"]), $this->AutoAsciiExt))) $mode=FTP_ASCII; else $mode=FTP_BINARY; if(!$this->_data_prepare($mode)) { fclose($fp); return FALSE; } if($this->_can_restore and $rest!=0) $this->restore($rest); if(!$this->_exec("STOR ".$remotefile, "put")) { $this->_data_close(); fclose($fp); return FALSE; } if(!$this->_checkCode()) { $this->_data_close(); fclose($fp); return FALSE; } $ret=$this->_data_write($mode, $fp); fclose($fp); $this->_data_close(); if(!$this->_readmsg()) return FALSE; if(!$this->_checkCode()) return FALSE; return $ret; }