Page 1 of 1

php Code to start download of pdf

Posted: Wed Aug 18, 2010 4:08 am
by shivchal
Hi all,
I have a website with a link to pdf, present in the site. When I click that link, the pdf opens in the browser. Is there a way to download the PDF?
When I click on the link to pdf, I don't want the browser to open in a new tab, but instead prompt for typical file download option. "Save As or open with".

Thanks a lot for all your voluntary help.

regards,
shiva

Re: php Code to start download of pdf

Posted: Wed Aug 18, 2010 7:18 am
by requinix
With PHP you'd use header. At a server level you can force a "application/octet-stream" content type on whichever files should be downloaded.