Thursday, March 13, 2008

How to Serve PDF Downloads with a PHP Script?

This next script enables you to serve PDF downloads. It is handy for when you want to make a single PDF available for both online reading and downloading. You can use its technique of using the Content-Type and Content-Disposition headers in any script that serves download-only PDF.

Download the script in http://ifile.it/5ul9ewn

If you have a PDF located at http://www.pdfvault.com/docs/mydoc.pdf and you copied the preceding script to http://www.
pdfvault.com/docs/pdfdownload.php, the URL http://www.pdfvault.com/docs/pdfdownload.php?fn=mydoc.pdf would prompt users to download mydoc.pdf to their computers.

0 comments: