Passe par un script php pour lancer le téléchargement :
LDLL : <a href="/download.php?file=<?php echo $lien_li_int['li_int']; ?>">Téléchager<br /></a>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <?php
// TODO: vérifications de $_GET['file']
$filePath = 'files/' . $_GET['file'];
$fileName = 'nomduficher.txt';
header('Content-Disposition: attachment; filename="' . $fileName . '"');
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($filePath));
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
readfile($filePath); |
Partager