header( "Pragma: public" );
      header( "Expires: 0" ); // set expiration time
      header( "Cache-Component: must-revalidate, post-check=0, pre-check=0" );
      header( "Content-type:".$this->mineType );
      header( "Content-Length: " . filesize( $this->filename ) );
      header( "Content-Disposition: attachment; filename="$fn"" );
      header( 'Content-Transfer-Encoding: binary' );
      readfile( $this->filename );

解决方案 »

  1.   

    http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
      

  2.   

    前3条是缓存相关的,指定这个文件缓存立即过期,不使用缓存等。实际都是一个意思,为了兼容不同浏览器所以要全写上。
    第4条是指定这个文件的类型的,一般的网页就是text/html。图片是image/jpg等,可以使用标准的类型或自定义
    第5条是说明这文件的长度为(字节)
    第6条是说明这文件下载的话默认存为什么名称
    第7条是说明这是个二进制文件第8行读取并显示文件正文