From 700c83125e3075be837e0dc1d5b23e88c15d950f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 31 Dec 2011 02:50:37 +0100 Subject: [PATCH] New: Add file size and description into download wrapper --- htdocs/document.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/document.php b/htdocs/document.php index 7e4ad347a01..ecac2268886 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -535,15 +535,19 @@ else // Open and return file // Les drois sont ok et fichier trouve, on l'envoie + header('Content-Description: File Transfer'); if ($encoding) header('Content-Encoding: '.$encoding); if ($type) header('Content-Type: '.$type.(preg_match('/text/',$type)?'; charset="'.$conf->file->character_set_client:'')); if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"'); else header('Content-Disposition: inline; filename="'.$filename.'"'); - + header('Content-Length: ' . dol_filesize($original_file)); // Ajout directives pour resoudre bug IE header('Cache-Control: Public, must-revalidate'); header('Pragma: public'); + //ob_clean(); + //flush(); + readfile($original_file_osencoded); }