par
greg6fr » 16 déc. 2013, 18:01
Bonjour,
je voudrais télécharger 3 documents (Ville1.xlsx, Ville2.xlsx, Ville3.xlsx) avec le code php ci-dessous.
Mais mon script php ne me retourne qu'un seul telechargement. Ce qui n'est pas normal.
Voici le code
Code : Tout sélectionner
<?php
for($i=1;$i<=3;$i++)
{
$fileName = "files/Ville".$i.".xlsx";
header('Content-disposition: attachment; filename='.$fileName);
header('Content-Type: application/force-download');
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($fileName));
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
readfile($fileName);
}
?>
Bonjour,
je voudrais télécharger 3 documents (Ville1.xlsx, Ville2.xlsx, Ville3.xlsx) avec le code php ci-dessous.
Mais mon script php ne me retourne qu'un seul telechargement. Ce qui n'est pas normal.
Voici le code
[code]
<?php
for($i=1;$i<=3;$i++)
{
$fileName = "files/Ville".$i.".xlsx";
header('Content-disposition: attachment; filename='.$fileName);
header('Content-Type: application/force-download');
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($fileName));
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
readfile($fileName);
}
?>
[/code]