lesser-equity

Magazine
Go Back   Computer Juice > Computer Software > Web Design, Hosting & SEO


Register


Reply
 
Thread Tools
  #1  
Old 31st May 2009, 14:12
New Member Group
 
Hi,

I'm trying to password protect some PDF files and I thought I would go about it this way:

PHP Code:


That worked great in my primary web browser, but I checked it in Firefox which didn't have the Adobe Reader plugin installed and I ran into a problem. It wanted to download the file, but with a .php extension. The file downloaded fine and would have displayed had I changed the extension from .php to .pdf

I put in:
PHP Code:
header('Content-Disposition: attachment; filename="file.pdf"');


to solve the problem, but now it downloads on browsers that have the plugin installed as well. This isn't a huge problem, but I would prefer (for the user's convenience) that the file would open up in-browser if possible.

I don't know how I could fix this besides only including the Content-Disposition if the user had the plugin installed, but I couldn't find a way to check that.

Any suggestions or do you think I should just let everyone download the files to the desktop before viewing them?

P.S. I hope this makes sense. Let me know if I need to clarify.
Reply

Register
Thread Tools




Arabic Bulgarian Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Finnish French German Greek Hebrew Hungarian Italian Japanese Korean Latvian Lithuanian Norwegian Polish Portuguese Romanian Russian Serbian Slovak Spanish Swedish Thai Turkish Ukrainian

Copyright ©2006 - 2009 Computer Juice.

Powered by vBulletin® Copyright ©2000 - 2009 Jelsoft Enterprises Ltd. SEO by vBSEO ©2009, Crawlability, Inc.