我試圖將上傳的文件移動到遠程服務器上,但這不起作用;將上傳的文件移動到遠程服務器
move_uploaded_file($ tmp_name,「uploads/$ code1/$ code。$ fileex」);
$ftp_server = "IP";
$ftp_user_name = "username";
$ftp_user_pass = "password";
$file = $tmp_name;
$remote_file = "/public_html/test/uploads/";
// set up basic connection
$conn_id = ftp_connect($ftp_server);
// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
// upload a file
if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) {
echo "successfully uploaded $file\n";
} else {
echo "There was a problem while uploading $file\n";
}
// close the connection
ftp_close($conn_id);
我得到這個erorr;
警告:ftp_put()[function.ftp-放]:無法打開該文件:是在/home/file/public_html/uploaded.php目錄上線52
什麼樣的錯誤是否收到??? – powtac 2012-03-08 17:43:41