当前位置:编程学习 > php >>

PHP通过FTP上传文件问题

<html> <head> <title>Mirror update</title> </head> <body> <h1>Mirror update</h1> <?php $host='xxxx'; $user='xxx'; $password='xxxx'; $conn=ftp_connect($host,21); if(!$conn) { echo'Error,could not connect to ftp server...:('; exit; } $result=ftp_login($conn,$user,$password); echo '<br />'; echo $result; //i want to see what result is...haha echo '<br />'; if(!$result) { echo' Either your id or password is wrong!!..'; exit; } $file='H:/123.txt'; $remote_file='/123.txt'; if (ftp_put($conn, $remote_file, $file, FTP_ASCII)) { echo "successfully uploaded $file\n"; } else { echo "There was a problem while uploading $file\n"; } ftp_close($conn); ?> </body> </html> 无法上传,我感觉是路径的问题,就高手指点
追问:conn  result都是对的啊
就是这行错了(ftp_put($conn, $remote_file, $file, FTP_ASCII))Warning: ftp_put() [function.ftp-put]: Permission denied.
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,