PHP forces you to download the file code

  • 2020-03-31 21:21:10
  • OfStack

 
<?php 
$filename = '1.png'; 
header("Content-Type: application/force-download"); 
header('Content-Disposition: attachment; filename="'.$filename.'"'); 
echo $filename; 
?> 

Related articles: