function download($inline = false)
{
// Fix [3164]
while (@ob_end_clean());
if( $this->_isLink ){
header( "Location: " . substr( $this->name , 6 ) );
return;
}
$fsize = @filesize($this->path.$this->name);
$mod_date = date('r', filemtime( $this->path.$this->name ) );
$cont_dis = $inline ? 'inline' : 'attachment';
// required for IE, otherwise Content-disposition is ignored
if(ini_get('zlib.output_compression')) {
ini_set('zlib.output_compression', 'Off');
}
header("Pragma: public");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
header("Content-Transfer-Encoding: binary");
header('Content-Disposition:' . $cont_dis .';'
. ' filename="' . iconv('utf-8','gb2312',$this->name) . '";'
. ' modification-date="' . $mod_date . '";'
. ' size=' . $fsize .';'
); //RFC2183
header("Content-Type: " . $this->mime ); // MIME type
header("Content-Length: " . $fsize);
if( ! ini_get('safe_mode') ) { // set_time_limit doesn't work in safe mode
@set_time_limit(0);
}
// No encoding - we aren't using compression... (RFC1945)
//header("Content-Encoding: none");
//header("Vary: none");
$this->readfile_chunked($this->path.$this->name);
// The caller MUST 'die();'
}
. ' filename="' . $this->name . '";'