Envoyé par
gene69
nan ! faut donner des chemin locaux à filesize() & consort, et comme on a souvent deux environnements __DIR__ (php5.3) est très utile.
Question subsidiaire: $ftp_path <=> http:// ?!?
bonjour,
je suis nouveaux sur le PHP,
je comprend pas trop le chemin locaux à filesize.... c'est quoi ?
j'ai modifié mon script php:
1 2 3 4 5 6 7 8 9 10 11 12 13
| <?php
$fichier = trim($_GET['cuisine.mpg']);
$ftp_path = 'mysite.com/'.$fichier;
$size = filesize($ftp_path);
ini_set("memory_limit","500M");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $size");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=".$fichier);
ob_clean();
flush();
readfile($ftp_path);
?> |
et le HTML:
<p><A href="http://www.mysite.com/teste-a.php" target="_blank"> veuillez cliquer pour télécharger </A></p>
après avoir cliquer "veuillez cliquer pour télécharger", il affiche aussi : veuillez cliquer pour télécharger,
j'aimerais savoir comment faire afficher la fênetre de téléchargement ?
mon URL:http://www.mysite.com
nom de fichier dans le serveur:cuisine.mpg est une vidéo à 250Mo
Partager