readfile不支持http,不過讀取http://....,會自動以http連接,而不會讀取裏面的數據

解决方案 »

  1.   

    LeeMaRS(小菜虎_水壶的仇人),谢谢!wasy(嘻嘻哈哈) ,绝对支持,不信你可以实验一下啊
      

  2.   

    呵呵,其实wasy说的没错.不信你readfile远端的一个PHP文件看看就知道了:)
    因为你的文件是TXT,用http连接后也是原封不动的读出来,所以readfile还是用得了的.详细的说明看下面:readfile
    (PHP 3, PHP 4 )readfile -- Outputs a file
    Description
    int readfile ( string filename [, int use_include_path])
    Reads a file and writes it to standard output. Returns the number of bytes read from the file. If an error occurs, FALSE is returned and unless the function was called as @readfile, an error message is printed. If filename begins with "http://" (not case sensitive), an HTTP 1.0 connection is opened to the specified server and the text of the response is written to standard output. Versions prior to PHP 4.0.5 do not handle HTTP redirects. Because of this, directories must include trailing slashes. If filename begins with "ftp://" (not case sensitive), an ftp connection to the specified server is opened and the requested file is written to standard output. If the server does not support passive mode ftp, this will fail. If filename begins with neither of these strings, the file will be opened from the filesystem and its contents written to standard output. You can use the optional second parameter and set it to "1", if you want to search for the file in the include_path, too. See also fpassthru(), file(), fopen(), include(), require(), and virtual(). 
      

  3.   

    我是这样做的 $STR=READFILE(……)
      

  4.   

    readfile -- Outputs a file
    Description
    int readfile ( string filename [, int use_include_path])
    Reads a file and writes it to standard output. Returns the number of bytes read from the file. If an error occurs, FALSE is returned and unless the function was called as @readfile, an error message is printed. If filename begins with "http://" (not case sensitive), an HTTP 1.0 connection is opened to the specified server and the text of the response is written to standard output. 我没有看完,hehe:)
      

  5.   

    老兄,readfile返回整形长度,你用来做什么呀?
    用file返回数组,然后再处理还差不多
      

  6.   

    带宽100m你的读取速度就有100m?
    如果不是在同一机房,那么最多10m,如果不是统一网断,可能10k都没有
      

  7.   

    好像所谓的100M带宽是100Mbits的带宽吧...
    而文件100M是100Mbytes的大小...
    按最小比例,1byte=8bit...那么100Mbits/8=1XMbytes而已.
    如果加上奇偶校验码那就是100Mbits/9...更小了...传送100M文件大概几秒吧.
    当然带宽不可能100%使用,再加上机房其他机占有带宽...那么就可能会很慢了...