| Solution et sécurité | | De Florian PERRICHOT - Dimanche 23 Septembre 2001 à 14:09
Voila un code qui doit fonctionner mieux :
if ( eregi( 'MSIE', $HTTP_USER_AGENT ) || eregi( 'OPERA', $HTTP_USER_AGENT ) ) $mime_type = 'application/octetstream';
else $mime_type = 'application/octet-stream';
header('Content-Type: ' . $mime_type);
if ( eregi( 'MSIE', $HTTP_USER_AGENT ) ) $content_disp = 'inline';
else $content_disp = 'attachment';
header('Content-Disposition: '.$content_disp.'; filename="'.$nomdufichier.'"');
header('Pragma: no-cache');
header('Expires: 0');
POUR DES RAISONS DE SECURITE NE JAMAIS PASSER DANS L'URL LE NOM DU FICHIER !!!
|
|