14 lignes
Pas d'EOL
470 o
PHP
14 lignes
Pas d'EOL
470 o
PHP
<?php
|
|
if($allowed){
|
|
header('Content-Type:'.$MIMEType);
|
|
header('Content-Length: '. $size);
|
|
header('Content-disposition: attachment; filename='. $fileName);
|
|
header('Pragma: no-cache');
|
|
header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0');
|
|
header('Expires: 0');
|
|
readfile($path);
|
|
}
|
|
else{
|
|
echo 'Téléchargement impossible ou non autorisé';
|
|
}
|
|
|