Method One:
Copy CodeThe code is as follows:
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);
Method Two:
Copy CodeThe code is as follows:
$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.html www.bkjia.com true http://www.bkjia.com/PHPjc/328007.html techarticle method One: Copy the code code as follows: Header (' Content-description:file Transfer '); header (' Content-type:application/octet-stream '); Header (' Content-disposition:attachment; fil ...