在对方unix服务器上下载数据,文件大小都能读出来,就是内容下载不了,什么原因呀,错误提示如下
501
Warning: ftp_get() [function.ftp-get]: Opening ASCII mode data connection for 50001_Award_8_514772.txt (501 Bytes). 

解决方案 »

  1.   

    501的意思是:Syntax error in parameters or arguments.贴下你的代码
      

  2.   

    可能是因为防火墙,在ftp_get()之前加上ftp_pasv($resource, true);原文摘自php网站文档的注释:http://php.net/manual/en/function.ftp-put.php
    ========================================================================
    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
      

  3.   

    帮忙看看,收不到内容
    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);