News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Ask Apache Blog:
A better way to use PDF files online
November 26, 2007 @ 11:11:00

From the Ask Apache blog, there's a quick tip that makes it simple to give your site's visitors the option to either download or view a PDF file no matter what their browser default is.

One of the most annoying things on the Internet for me is when I click on a link to an Adobe PDF file. For me this is annoying to the extreme because the PDF file is openened directly in your browser because of the Adobe PDF Plugin that almost all browsers have installed. [...] For me an ideal solution would be to offer me choices.

His solution uses mod_rewrite in an .htaccess file to push the visitor to a PHP file. This file grabs the filename they want and pulls in the content, pushing it back out the other side with the "attachment" header that forces a request box on the browser.

0 comments voice your opinion now!
pdf file modrewrite htaccess save open choice pdf file modrewrite htaccess save open choice


blog comments powered by Disqus

Similar Posts

Jim Plush's Blog: Do you use debug statements in PHP? Speed them up by 85%

Rob Allen's Blog: Zend Framework Tutorial for ZF v0.8

Sameer Borate's Blog: Read the version of a PDF in PHP

Sudheer Satyanarayana's Blog: Zend Date Class Constants Cheat Sheet

LeaseWebLabs.com: How to use the “yield” keyword in PHP 5.5 and up


Community Events





Don't see your event here?
Let us know!


opinion language series configure release introduction interview threedevsandamaybe unittest framework composer list conference version api laravel community voicesoftheelephpant symfony podcast

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework