本帖最后由 isec 于 2011-05-29 22:50:00 编辑

解决方案 »

  1.   

    为什么不用 get_headers 函数呢?
      

  2.   

    function remote_filesize($url_file){ 
        if (!remote_file_exists($url_file)) return false; 
        $headInf = get_headers($url_file,1); 
        return $headInf['Content-Length']; 
    }
      

  3.   

    谢谢两位的回答。但是get_headers方法使用的就是head method,所以返回的content-length是0,参见背景部分。
    另外需要纯粹用curl库的函数来完成这项工作,否则方法就很多了。昨天我已经解决了这个问题。
      

  4.   

    isec,想问下如何解决呢?能贴下答案呢
      

  5.   

    curl_getinfo() 也是需要exec后才有效!
    不获取完整貌似不行吧