[Recherche] script de telechargement

pktre Messages postés 2 Date d'inscription mardi 2 mars 2004 Statut Membre Dernière intervention 3 avril 2005 - 27 sept. 2004 à 22:55
quiaimeflash Messages postés 270 Date d'inscription samedi 29 novembre 2003 Statut Membre Dernière intervention 11 juillet 2007 - 28 sept. 2004 à 20:30
slt all , je recherche un script php de telechargement comme dans phpnuke , xoops , etc ...

si kelkun en coné svp

URGENT (pour site professionnel a mettre en ligne o plus tot)
Merci

2 réponses

tardigrade Messages postés 208 Date d'inscription mercredi 22 janvier 2003 Statut Membre Dernière intervention 2 décembre 2008
28 sept. 2004 à 17:59
$chemin=realpath($chemin);
$fichier=basename($chemin);
header('Content-type: application/force-download');
header('Content-Disposition: attachment; filename='.$fichier);
readfile($chemin);
0
quiaimeflash Messages postés 270 Date d'inscription samedi 29 novembre 2003 Statut Membre Dernière intervention 11 juillet 2007
28 sept. 2004 à 20:30
Il faut que tu place le code suivant dans un nouveau fichier car sinon sa va pas marcher ou alors il faut qu'il n'y i rien avant, enfin test...

<?php
$langfile = "test.txt";
header("Content-Type: octet-stream");
header("Content-Length: ".filesize ($langfile) );
header("Content-Disposition: attachment; filename=$langfile");
include($langfile);
?>
0
Rejoignez-nous