Forcé le download non compatible avec IE

Forcé le download non compatible avec IE - PHP - Programmation

Marsh Posté le 26-10-2006 à 21:20:18    

Bonjour,
 
Voila j'ai un script qui me génère un script et qui force le download. Celui-ci fonctionne tres bien avec firefox masi avec IE6 il m'affiche un message d'erreur mais je ne comprends pas pourquoi.
 
l'exemple est a cette adresse : http://staging.uniteloverval.be/download.php?idAlbum=1
 

Code :
  1. require('include/lib_zip.php');
  2. $fichier_zip ="zip.zip";      // nom du fichier zip que l'on veut
  3. $zip    = new zipfile();
  4. $path    = "photos";      // repertoire que l'on veut zipper
  5. function zipDir($path,&$zip){
  6.    if(!is_dir($path))return;
  7.    if(!($dh=@opendir($path))){
  8.    return;
  9.    }
  10.    while($file=readdir($dh)){
  11.   if($file=="."||$file==".." )continue;   // Throw the . and .. folders
  12.   if(is_dir($path."/".$file)){      // Recursive call
  13.   zipDir($path."/".$file,$zip,$i);
  14.   }elseif(is_file($path."/".$file)){   // If this is a file then add to the zip file
  15.   $zip->addFile(file_get_contents($path."/".$file),$path."/".$file);
  16.   }
  17.   }
  18. }
  19. zipDir($path,$zip);
  20. $filezipped = $zip->file();   // On recupere le contenu du zip dans la variable $filezipped
  21. header('Content-type: application/zip');
  22. header('Content-Disposition: attachment; filename="telechargement.zip"');
  23. echo $filezipped;


 
Merci d'avance

Reply

Marsh Posté le 26-10-2006 à 21:20:18   

Reply

Marsh Posté le 27-10-2006 à 05:38:18    

:d
Lis ton fichier et envois le plutot par paquet qu'un vilain echo ;)
 
Il doit manquer aussi quelques header qui vont bien pour que tout le monde comprenner bien ;)

Reply

Marsh Posté le 27-10-2006 à 14:15:05    

ca fonctionne sous ie6 ton lien :o


---------------
Hobby eien /人◕ ‿‿ ◕人\
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed