<?php
function docdownload($filename)
{
$NomFichier = basename($filename);
$taille=filesize($filename);
ob_end_clean();
header("Content-Type: application/force-download; name=/"$NomFichier/"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: $taille");
header("Content-Disposition: attachment; filename=/"$NomFichier/"");
header("Expires: 0");
header("Cache-control: private");
header("Pragma: no-cache");
readfile($filename);
}
docdownload("asd.doc");
?>