Sunday, August 09, 2009

Force Download a file with filename using PHP

To force download a file and specifying a filename we need to send the header as below
header('Content-Disposition: attachment; filename="somefile.someextn"');
if we do not specify the content disposition the the file tends to open in the browser.
hope it helps

Web Hosting Cheap PHP Plans Also at For free flags of the world