复制代码 代码如下:
header('content-description: file transfer');
header('content-type: application/octet-stream');
header('content-disposition: attachment; filename='.basename($filepath));
header('content-transfer-encoding: binary');
header('expires: 0′);
header('cache-control: must-revalidate, post-check=0, pre-check=0′);
header('pragma: public');
header('content-length: ' . filesize($filepath));
readfile($file_path);
方法二:
复制代码 代码如下:
$fileinfo = pathinfo($filename);
header('content-type: application/x-'.$fileinfo['extension']);
header('content-disposition: attachment; filename='.$fileinfo['basename']);
header('content-length: '.filesize($filename));
readfile($thefile);
exit();
http://www.bkjia.com/phpjc/328007.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/328007.htmltecharticle方法一: 复制代码 代码如下: header('content-description: file transfer'); header('content-type: application/octet-stream'); header('content-disposition: attachment; fil...
