Dans le cadre d'une appli où s'effectuera des téléchargements de vidéos en wmv, je bute sur le problème suivant:
Le fichier, d'une taille de 5M (par ex), ne pèse qu'environ 300ko, lorsque je teste le download !
Voici le header avec lequel je teste l'opération:
CODE
if ($_POST['submit'] == "Download")
{
$filename = trim($_POST['file_dwd']);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=".basename($filename).";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
readfile($_SERVER['DOCUMENT_ROOT']."vid/".$_SESSION['rep']."/dwd/".$_POST['file_dwd']);
exit(0);
}
{
$filename = trim($_POST['file_dwd']);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=".basename($filename).";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($filename));
readfile($_SERVER['DOCUMENT_ROOT']."vid/".$_SESSION['rep']."/dwd/".$_POST['file_dwd']);
exit(0);
}
Je précise que les variables sont toutes bien renseignées.
Voyez-vous une erreur ?
Merci de vos réponses,
xpatval