Current location: Hot Scripts Forums » General Community » Script Requests » stopping direct download of my pdf files ..


stopping direct download of my pdf files ..

Reply
  #1 (permalink)  
Old 01-22-04, 10:50 PM
markmarkymark markmarkymark is offline
New Member
 
Join Date: Jan 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Question stopping direct download of my pdf files ..

Greetings All !

I'm new here and thought I would get right on with a little question.

The basic problem is this :

I have a website with a number of pages, hosted on a fasthosts windows server. One of my pages contains serveral link which link directly to some PDF files. These files are free to download. Google as spidered my site well.

If you do a search on specific terms google will more than likely bring up a direct link to the PDF files. Whilst this is not a problem in itself (after all I want them listed) it means that someone can go direct to the PDF file without visiting the page where the links are. Thus they do not get a chance to see what else is on offer etc. Furthermore, one could put a direct link to the PDF files and sponge I guess ....

What I am after is some simple way of enuring that the user has to obtain the PDF from the link page. What I want to avoid is a situation where they get put off if, for example, clicking on a google link to the PDF file leads to a 'page error' or similar. I thought about redirection but the PDF file is not a page its just a file ....

I thought about emedding the PDF file in an actual page some how - but not sure thats reliable ...

I can password protect a folder on my server, so I thought about password protected the PDF file - but giving the password on the web page. The problem with this is that if they try to view the PDF from a google search listing it will bring up the password box, and if they do not know it (which they will not !) then it might end in a page error (or you do not have permission to view this page etc). I think that might put people off ....

so, (sorry for rammble), anyone got any ideas / scrips which will help me achieve this in a simple way ....

thanks for reading !

cheers

Mark
Reply With Quote
  #2 (permalink)  
Old 01-23-04, 01:38 AM
markmarkymark markmarkymark is offline
New Member
 
Join Date: Jan 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
just to add

I might just add that what I think i'm trying to stop is hotlinking

Mark
Reply With Quote
  #3 (permalink)  
Old 01-23-04, 02:06 AM
MadDog MadDog is offline
Code Master
 
Join Date: Aug 2003
Posts: 935
Thanks: 0
Thanked 0 Times in 0 Posts
If you want to stop the search engine direct link make a robots.txt file and add the files that you dont want indexed.

If you dont know about a robot.txt file do a search on google, you can find lots of information on it.
__________________
Drew Gauderman
ASP - MSSQL Coder / Buisness Owner / Coder for Hire!
MSN-ICQ-AIM-YIM in Profile

http://www.iportalx.net an easy ASP portal system.
Reply With Quote
  #4 (permalink)  
Old 01-23-04, 02:14 AM
markmarkymark markmarkymark is offline
New Member
 
Join Date: Jan 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by MadDog
If you want to stop the search engine direct link make a robots.txt file and add the files that you dont want indexed.

If you dont know about a robot.txt file do a search on google, you can find lots of information on it.
Thanks ....

Actually I'm happy for them to be spidered. All I want is that then a spidered file is index, or where someone is sponging the file (as is also the case) they are directed to the download page rather than getting the file remotely .....

Bascically I have some pdf files for download. one organisation is linking directly to the file, rather then to the page where the file download links are. I am fine with them linking to the page, but not happy linking to the file direct ...
Reply With Quote
  #5 (permalink)  
Old 01-23-04, 09:49 AM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,171
Thanks: 3
Thanked 9 Times in 9 Posts
You can prevent hotlinking to the file by changing the setting on your server. But it depends on the type of server you are running. Could you give more information on that?

Alternatively, you can embed a JavaScript code in the PDF file itself. All you would have to do is to create a field with a white background on top of the contents of each page of your document and set it to ".hidden". You would then be able to create a tracking field with a bool value that is set to true if the user looks at the document directly but is set to false if the document is viewed through your index page. This value would determine if the content of the PDF file is viewable or not. The value of this tracking field would be set by initiating a ".fdf" file which imports a 0 value to the PDF document, which would in turn allow the user to see the contents of the PDF file.

If you didn't understand a word of what I just said, contact me at webmaster@digioz.com to talk about it. I would be willing to do this for you for a small fee if you need it.






Quote:
Originally Posted by markmarkymark
Thanks ....

Actually I'm happy for them to be spidered. All I want is that then a spidered file is index, or where someone is sponging the file (as is also the case) they are directed to the download page rather than getting the file remotely .....

Bascically I have some pdf files for download. one organisation is linking directly to the file, rather then to the page where the file download links are. I am fine with them linking to the page, but not happy linking to the file direct ...
__________________
Reply With Quote
  #6 (permalink)  
Old 01-23-04, 01:35 PM
nakulgoyal nakulgoyal is offline
Coding Addict
 
Join Date: Jun 2003
Posts: 283
Thanks: 0
Thanked 0 Times in 0 Posts
Re:

There are several download redirection scripts that you can use...!!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Download files from another server using script! benweston Script Requests 5 01-17-06 09:29 AM
Upload file to table so ONLY files tied to primary key are displayed in record? grafixDummy PHP 4 12-20-03 04:28 PM
download files sasi ASP 0 09-10-03 08:29 PM
Digitally 'watermark' files Safrane PHP 4 09-08-03 09:02 AM
Upload and download counting. Arctic ASP 2 08-16-03 10:44 PM


All times are GMT -5. The time now is 09:28 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.