1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
<?php
session_start(); // On relaye la session
if (session_is_registered("jsduznnhsbzhnzizop")){ // vérification sur la session authentification (la session est elle enregistrée ?)
}
else {
header("Location:index.php?erreur=intru");
exit;
}
include("interdit/conf.php");
$fichier=str_replace('/','',$_GET['url']);
$fichier=trim($fichier);
$path = 'dossier/'.$dos.'/'.$fichier;
if (is_file($path))
{
//$type = mime_content_type($path);
$extension=substr($fichier,strrpos($fichier,".")+1);
$extension= strtolower($extension);
if($extension=="doc"){$type="application/msword";}
if($extension=="jpg"){$type="image/jpeg";}
if($extension=="jpeg"){$type="image/jpeg";}
if($extension=="pdf"){$type="application/pdf";}
//if($extension=="xls"){$type="application/excel";}
if($extension=="xls"){$type="application/vnd.ms-excel";}
if($extension=="zip"){$type="application/zip";}
if($extension=="flv"){$type="application/x-shockwave-flash";}
header('Content-type: ' . $type);
readfile($path);
} else {
echo "Lecture impossible <br>";
echo "Contactez l'administrateur<br>";
}
?> |
Partager