un code que j'ai pour download un truc
[fixed]
<?
if($_GET["dwn"]) {
// ob_clean(); // Vide le buffer (v >= 4.2)
// Dialogue de téléchargement
header("content-type: application/octet-stream");
// seulement pour application/octet-stream !
header("Content-Disposition: attachment; filename=".$_GET["dwn"]);
// Ouvrir avec MSWord
// header("content-type: application/msword");
// Ouvrir avec MSExcel
// header("content-type: application/vnd.ms-excel");
// Ouvrir en Text
// header("content-type: text/plain");
// voir aussi
Vous devez être
connecté pour voir les liens.
flush(); // Envoie le buffer
readfile($_GET["dwn"]); // Envoie le fichier
} else { ?>
<A href="download.php?dwn=download.php">Test</A>
<? } ?>
[/fixed]