Jump to content

protecting some PDFs


rondog

Recommended Posts

I have a directory with some PDFs. Once a user logs in they have access to these links. My problem is google has indexed these PDFs and I know robots.txt will help with that, but what about other search engines? Can I use PHP to restrict access to the PDFs unless a user is logged in?

Link to comment
https://forums.phpfreaks.com/topic/121600-protecting-some-pdfs/
Share on other sites

ok I am doing:

<?php
$file = "../../pdfs/policy.pdf";
header("Content-type: application/pdf");
header("Content-Disposition: inline; filename=\"policy.pdf\""); 
readfile($file);
?>

 

and its force downloading the pdf..I want it to just open in the browser..any idea?

Link to comment
https://forums.phpfreaks.com/topic/121600-protecting-some-pdfs/#findComment-627288
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.