Hello !
J'ai testé une dizaine de script => loupé
je veux forcer un download fichier texte
je suis certain du chemin que j'entre en variable
a chaque fois :
dans la fenêtre download, j'ouvre (via bloc note)
le fichier liste.txt est marqué liste-15.txt en entete de notepad et 15 est le nombre d'essais de téléchargement !
Bref marche pas
le script
et j'applique telecharge('liste.txt','liste.txt');
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 function telecharge($nom, $situation) { // téléchargement du fichier header('Content-disposition: attachment; filename='.$nom); header('Content-Type: application/force-download'); header('Content-Transfer-Encoding: fichier'); header('Content-Length: '.filesize($situation)); header('Pragma: no-cache'); header('Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0'); header('Expires: 0'); readfile($situation); }
le liste.txt est dans le répertoire de la fonction
merci du coup de main







Répondre avec citation
Partager