Showing posts with label PHP - Header files. Show all posts
Showing posts with label PHP - Header files. Show all posts

Saturday, August 9, 2008

PHP file download using header functions

header("Cache-Control: public");
header("Content-Description: File Transfer");
header('Content-disposition: attachment; filename='.basename($filename));
header("Content-Type: application/pdf");
header("Content-Transfer-Encoding: binary");
header('Content-Length: '. filesize($filename));
readfile($filename);

PHP header file types

header('Content-type: application/pdf');
header('Location: http://ashokseenivas.blogspot.com/');
header("HTTP/1.0 404 Not Found");
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sun, 10 Aug 2008 05:00:00 GMT");
header('Content-type: text/xml');