Communiquez avec les autres et partagez vos connaissances professionnelles

Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.

Suivre

Write a PHP script to report the total download size of any URL.

user-image
Question ajoutée par Julfkar Moh Umar , Sr. Software Engineer , Aakash Edutech Private Limited
Date de publication: 2016/01/13
NOOR MOHAMMAD
par NOOR MOHAMMAD , Manager Operations , SHAAIER TOUR DEVELOPMENT

function downloadFile($file){// Set up the download system... header('Content-Description: File Transfer'); header('Content-Type: '.mime_content_type($file)); header('Content-Disposition: attachment; filename="'.basename($file).'"'); header('Content-Transfer-Encoding: binary'); header('Expires:0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: '.filesize($file));// Flush the cache ob_clean(); flush();// Send file to browser readfile($file);// DO NOT DO ANYTHING AFTER FILE DOWNLOADexit;}

More Questions Like This