Bonjour,
mon script génère parfois cette erreur :
Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found...
Ca peut venir de quoi selon vous ? Du script ?
Tazmiii
Je pensais au départ à un problème de version d'acrobat, mais ce n'est pas certain à 100%. Chez moi, ca ne pose pas de problème, sur d'autres postes non plus c'est pour cela que j'aurai tendance à penser que c'est plus un problème sur le poste client que de mon appli.internet explorer cannot download. Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found... ou bien impossible de lire ou de télécharger mon_fichier.php
Code : Tout sélectionner
<?php
if(!empty($_GET["id"])){
$nom = substr($_GET["id"]...);
if (file_exists($nom.'.pdf')) {
...
}
switch(strrchr(basename($nom), ".")) {
case ".gz": $type = "application/x-gzip"; break;
case ".tgz": $type = "application/x-gzip"; break;
case ".zip": $type = "application/zip"; break;
case ".pdf": $type = "application/pdf"; break;
case ".png": $type = "image/png"; break;
case ".gif": $type = "image/gif"; break;
case ".jpg": $type = "image/jpeg"; break;
case ".txt": $type = "text/plain"; break;
case ".htm": $type = "text/html"; break;
case ".html": $type = "text/html"; break;
default: $type = "application/octet-stream"; break;
}
header("Content-disposition: attachment; filename=".$nom.'.pdf');
header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: $type\n");
header("Content-Length: ".filesize($nom.'.pdf'));
header("Pragma: no-cache");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public");
header("Expires: 0");
readfile($nom.'.pdf');
}else{
header ("location:index.php");
}
}else{
header ("location:index.php");
}
?>Une idée Arthur ?Le fichier n'a pas pu être écrit sur le disque antémémoire
Code : Tout sélectionner
header("Pragma: no-cache");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public");