Tuesday, May 01, 2007

Forcing the files to be downloaded

Many of us have had to face the issue of making an txt file or .php file downloaded instead of the webserver parsing it and the browser displaying it. A simple entry as below in .htaccess and sometimes in your virtualhost section of httpd.conf can get this done.


Header add Content-Disposition "Attachment"

No comments: