J'utilise un script de dowload classique de fichier du serveur vers un client PC (downlaod.php):
Code : Tout sélectionner
<?
if( isset($_POST['download']) ){
$s_PathD = $_SERVER['DOCUMENT_ROOT'] . '/upload/' . $_POST['valC'];
$s_FileD = $_POST['ListeFileD'];
$s_GlobPath = $s_PathD . "/" . $s_FileD;
if( !$s_FileD ) exit;
/* Calcul de la taille */
$i_Taille = filesize( $s_GlobPath );
$type = "application/octet-stream"; break;
header("Content-Type: application/force-download;name=$s_GlobPath ");
header("Content-Transfer-Encoding:$type\n");
header("Content-Disposition: attachment;filename=$s_FileD");
header("Content-Length:$i_Taille");
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: 0");
readfile($s_GlobPath );
}
?>
IE s'entete à vouloir télécharger le script (download.php) :
"Internet Explorer ne peut pas télécharger download.php de ...."
J'ai essayé divers pistes sans succés (chemins différents, changement de répertoire, ... ).
Les autres restent fonctionnels (???).
Quelqu'un aurait une idée ?
Merci d'avance pour vos retours.