使用此
<?php
// define some variables
$local_file = 'filename.jpg';
$server_file = 'filename.jpg';
$ftp_server="www.abc.com";
$ftp_user_name="username";
$ftp_user_pass="password";
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// try to download $server_file and save to $local_file
if (ftp_get($conn_id, $local_file, $server_file, FTP_BINARY)) {
echo "Successfully written to $local_file\n";
}
else {
echo "There was a problem\n";
}
// close the connection
ftp_close($conn_id);
?>
你確定你的550,因爲在文件名中的字符1000%? –
未經授權,您通常會收到550錯誤。你有沒有檢查你的用戶名和密碼是否正確? – Marcus
爲什麼不使用ftp函數和ftp_login? - http://www.php.net/manual/en/ref.ftp.php – Smamatti