if (@$fp = fopen($download_file, 'rb'))
 
确定你在header送出之前不要输入任何内容。(空格都不行)
否则就出现你这样的错误。

解决方案 »

  1.   


        $name=trim(basename($filename)); //$filname 完整绝对路径即可
        header("Expires: " . gmdate("D, d M Y H:i:s",time()+24*3600) . " GMT");
        header("Cache-Control:");
        header("Pragma: cache");
        header("Connection: close");    if(strpos(getenv("HTTP_USER_AGENT") , "MSIE")){
            header("Content-type: application/download");
            header("Content-Disposition: filename=$name");
            header("Cache-Control: store, cache, must-revalidate, post-check=0, pre-check=0");
            header("Keep-Alive: close");
        }
        else
        {    
            header("Cache-Control: store, cache, must-revalidate, post-check=0, pre-check=0");
            header("Content-type: application/octet-stream");
            header("Content-Disposition: attachment;filename=$name");
        }    
        $fp=fopen($strFullPath,"rb");
        fpassthru($fp);
        flush();
        exit;这句对吗?
    $download_file  = $records->$link; ???????
      

  2.   

    这句对吗?
    $download_file  = $records->$link; ???????这句是函数调用,是得到文件名这$download_file,没有错误的。
      

  3.   

    header("Content-type: application/force-download");
    header("Content-Disposition: attachment; filename=abc.rar");
    这样就会弹出下载框了