我正在尝试使用一台主机通过FTP将内容上传到另一台主机.
" 我不会打开到172.xxx.xxx.xxx的连接(仅限于54.xxx.xxx.xxx) "甚至不相关,因为我没有连接到该主机.这是托管脚本的服务器的IP地址.但不是通过FTP访问的服务器.
$conn_id = ftp_connect('50.xxx.xxx.xxx');
ftp_pasv($conn_id, true);
$login_result = ftp_login($conn_id, 'user', 'pass');
$file = "http://example.com/filelocation.swf";
if (ftp_put($conn_id, "test.swf", $file, FTP_BINARY)) {
echo 'File Uploaded';
}
else {
echo 'Problem with uploading';
}
Run Code Online (Sandbox Code Playgroud)
ftp_put()我不会打开到172.xxx.xxx.xxx的连接(仅限54.xxx.xxx.xxx)
此错误中的IP地址不会转到我尝试连接的服务器.该ftp_login连接和无的问题.(我甚至不希望它连接到那些IP地址,所以为什么它甚至认为?)
我可以用来ftp_mkdir在服务器上添加目录.但是,当我使用时ftp_put,它会抛出该错误.