在对方unix服务器上下载数据,文件大小都能读出来,就是内容下载不了,什么原因呀,错误提示如下
501
Warning: ftp_get() [function.ftp-get]: Opening ASCII mode data connection for 50001_Award_8_514772.txt (501 Bytes).
501
Warning: ftp_get() [function.ftp-get]: Opening ASCII mode data connection for 50001_Award_8_514772.txt (501 Bytes).
========================================================================
If when using ftp_put you get the one of the following errors:Warning: ftp_put() [function.ftp-put]: Opening ASCII mode data connectionWarning: ftp_put() [function.ftp-put]: Opening BINARY mode data connectionand it creates the file in the correct location but is a 0kb file and all FTP commands thereafter fail. It is likely that the client is behind a firewall. To rectify this use:<?php
ftp_pasv($resource, true);
?>Before executing any put commands. Took me so long to figure this out I actually cheered when I did :D
set_time_limit(600);
$ftp_server="218.249.166.200";
$conn_id = ftp_connect($ftp_server,"8221") or die("Couldn't connect to $ftp_server");
ftp_login($conn_id,"sctest","222333");
ftp_pasv($conn_id, true);
echo ftp_get($conn_id,"abc.txt","/201007/02/50001_Award_8_514772.txt",FTP_ASCII);