Php ftp_get给出了晦涩的警告

时间:2016-08-25 18:32:49

标签: php ftp runtime-error warnings

我目前正在使用ftp_get尝试检索目录中的文件并将其转移到本地副本。随着它的进展它适用于前几个文件,但随后开始返回警告消息,如:

Warning: ftp_get(): 20130827142004 in /myfile.php on line 160

我的代码如下:

$ftpConnection = ftp_connect( $this->getHost() );
if ( false === $ftpConnection ) {
    throw new \Exception( "Failed to connect to the host {$this->host}" );
}

$ftpLogin = ftp_login( $ftpConnection, $this->getUsername(), $this->getPassword() );
if ( false === $ftpLogin ) {
    throw new \Exception( "Failed to login using the provided credentials" );
}

// Tried with and without pasv turned on
ftp_pasv( $ftpConnection, true );
$fileModTime   = ftp_mdtm( $ftpConnection, $origin ); // returns -1 for the files that fail ftp_get
ftp_get( $ftpConnection, $dest, $origin, FTP_BINARY );
ftp_close( $ftpConnection );

我不知道随机整数错误意味着什么,或者这些文件有什么不同。它们似乎与之前成功的所有文件大小相同。

0 个答案:

没有答案