1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <?php
$buffer="";
$mm_type="application/octet-stream";
$fichier = 'export.txt';
header("Cache-Control: public, must-revalidate, pre-check=0, post-check=0,max-age=0");
header("Pragma: public");
header("Content-Type: " . $mm_type);
header("Content-Length: " .(string)(filesize($fichier)) );
header('Content-Disposition: attachment; filename="'.basename($fichier).'"');
header("Content-Transfer-Encoding: binary\n");
$fp = fopen($fichier, 'rb');
fseek($fp,0);
$buffer = fread($fp, filesize($fichier));
fclose ($fp);
print $buffer;
?> |
Partager