This way, the file can be downloaded directly instead of opened. Principle analysis: 1. header ("Content-Type: application/force-download"); //Force download; 2. header ('Content-Disposition: attachment; filename="'.$filename.'"'); //Implement file download. Finally, readfile($filename) reads the file for download. |