Get support from Xavier Media
It is currently Sun Dec 08, 2013 8:02 pm

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: How can I protect a folder that only has PDF files in it?
PostPosted: Mon Jun 06, 2005 7:12 pm 

Points:
I use cookie password protection (love it!) but I found a problem with the folders that include just PDF files -- search engines have spidered them and now they are accessible to anyone who does a search on the topic! This is all property of my client and users have to pay for access to the site. Since I cannot put the "<? include" line in PDF files is there another way I can protect them? Thanks, any help would be greatly appreciated!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Tue Jun 07, 2005 8:16 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
Rename the folder where you have your PDF files and use file protection (included in Cookie Password Protection) to protect your files.


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject: File Protection
PostPosted: Tue Jun 07, 2005 10:19 pm 

Points:
I thought about using the File Protection program but I don't know how to get it to work. When I use the program as it's listed in the README (e.g. <A HREF="<? echo fileprotect("/SITE/manual/PDFSDONE/C1b_K_Intro3.pdf",0); ?>">Text</A>

All I get is a page error and this: <a href="

I am using cookie protection 1.1 on this page...I have this at the top and the page is protected:
<? include("/public_html/SITE/protection/protection.php"); ?>

What am I doing wrong?

Thanks!

Susan


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Jun 08, 2005 6:30 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
You should not use the entire path in the code, only the file name.

First you need to make sure you have the version of Cookie Password Protection 1.1 that includes FileProtection. To find out if file protection is included you simply open settings.php and search for the following code:
Code:
// If you're going to use file protection, then set this to the full
// path to your files. No / at the end!
$hiddendirectory = "/home/sampleaddress/public_html/filedemo";
Set $hiddendirectory to the full path to the hidden directory where you will hide your files. Then you only need to use the file name, like this:
Code:
<A HREF="<? echo fileprotect("C1b_K_Intro3.pdf",0); ?>">Text</A>


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject: Problem with protected PDF files within a folder
PostPosted: Thu Jul 14, 2005 5:40 pm 

Points:
Hi:

I have the same problem with v2.7 and at a lost. I put the full path in $hiddendirectory and in my normal html page I put a link

<A HREF="<? echo fileprotect("testfilename.pdf",0); ?>">TEST Link</A>

When I click on the Test Link on the page, it took me to my homepage index.htm instead. What have I done wrong? Could it be the full path I enter for $hiddendirectory is incorrect or something else.

Please help.

Thanks a lot.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Fri Jul 15, 2005 1:52 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
jamestay, I wouldn't call your problem the same as skallsens problem.

Create a new directory (for example members) and make a new file called index.php in it. Password protect index.php and put all your links to the PDF files in it (keep the actual files in the hidden directory). Then it will work.


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject:
PostPosted: Fri Jul 15, 2005 5:54 pm 

Points:
Thanks so much for your reply. Unfortunately, it still links to my homepage index.htm. I must be a nut or what.

Quote:
According to my ISP, my domain path is:
Destination: Web space
Home directory: /.
Complete web server path: /homepages/1/d115147745/htdocs/.
OR /kunden/ homepages/1/d115147745/htdocs/.


What I do is this:
- first, I entered the path in the settins.php $hiddendirectory="/homepages/1/d115147745/htdocs/pdfprotection";
- then I put all my pdf files inside pdfprotection folder to be protected
- create the index.php (with direct link to my pdf files), insert protection and put inside pdfprotection folder
- on my normal html web page, I add a link
<A HREF="<?echo fileprotect("index.php",0); ?>">Read PDF<?A>

When I click on the "Read PDF", the browser takes me back to my homepage index.htm. Same problem with path /kendun/.../pdfprotection

I have no problem to protect a php file that is in the same directory as the protection.php is installed but no luck with PDF files inside a protected folder.

What have I done wrong? Full path not right? Please help. I am desperate.

Thanks.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Sat Jul 16, 2005 12:24 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
You end up at your main index file because that's what you have told the script to do.

You did correct when you put all your PDF files in pdfprotection, but the protected index.php shouldn't be in that same directory! Instead create a new direcoty outside of pdfprotection (for example members)and put the index.php in that directory.

On your normal webpage you put a link like this
Code:
<A HREF="members/index.php">Read PDF</A>

Since you have the protection code at the top of members/index.php the member have to login first and will then see a list of links to your PDF files. The links to your PDF files should be protected by the file protection code like this:
Code:
<A HREF="<? echo fileprotect("testfilename.pdf",0); ?>">Read testfilename.pdf</A>


Please also read my last post in this topic.


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject:
PostPosted: Tue Jul 19, 2005 5:46 am 

Points:
Thank you so much for your great support and service. Yes, it works just find now.

Kudos to you, Bylla. The support has been superb and thanks again.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Oct 12, 2005 11:19 pm 

Points:
Search Google to see how but you should create a new folder - edit .htaccess to tell all search engines - i.e. google - not to spider files in your pdf file, depending on your amount of users you could also set up a user and password for the fodler, so entering the url of the pdf file will not allow users in at all and not being able to skip the password protected php file

also think about hotlink protection

Not sure if your host will support all these but worth a look and maybe worth upgrading to a better host with those features


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Thu Oct 13, 2005 4:28 am 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
When you use file protection (http://www.xaviermedia.com/php/fileprotection.phtml) you don't need to worry about hotlink protection because that's already built in. File protection will create links that are only valid for a specific number of minutes, so if Google spider the document it will only get the invalid login page.


Report this post
Top
 Profile Send private message  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 14, 2005 1:43 pm 

Points:
i am having sort of the same problem.. except that when you click to read a pdf file, you get forwarded to "login incorrect" page. I followed all the steps above and I know everything is set up correctly. The only thing I am thinking that might be wrong now is the path. I am trying to find out from techies if I have the correct one. lmk if you think something else could be wrong

$hiddendirectory = "/websites/mydomain.com/pdfdir <-- in settings file
<a href="<? echo fileprotect("myfile.pdf",0); ?>"> <-- on my content page


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 14, 2005 1:46 pm 

Points:
btw.. forgot to mention.. the script seriously kicks ass :wink:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Mon Nov 14, 2005 2:00 pm 
Offline
XavierForum.com Admin
XavierForum.com Admin
Super VIP Member
Super VIP Member
User avatar

Joined: Tue Mar 15, 2005 4:37 pm
Posts: 1082
Location: Sweden
Points: 1500
Make sure the path is correct and that you have correct cookie settings, the part where you set the domain name (.sampleaddress.com).


Report this post
Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Registered users: xlreariasd


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]