![]() |
How do I make a file downloadable only from my page?
Let's say I want anyone who downloads a file from my site to also view my site.
In other words I don't want anyone to be able to link to my downloads from their site. How do I do that? Thanks. |
Protect the directory. Google for "hot linking."
|
If you have your own host with Apache running... you could block access to only those you want to allow in with .htaccess files.
|
and how do I let others download then from within my site?
|
Perhaps read your responses and investigate further? It is not a subject that would be adequately covered in any but a long thread full of the flecks of hogwash that tend to accompany such threads. .htaccess is, in fact, one of the methods of protecting oneself against the phenomenon. It is also available on some servers not your own (my provider gives me the capability). Researching hot-linking, as previously suggested, would include the use of .htaccess and even give you an example of how to construct such a file. Please indulge in some personal initiative.
|
I've googled for some solutions.
I see they check the REFERER, but it can be faked. How is it fixed? |
|
If you want to protect your files from other sites leeching sites it will really prove to be a non-trivial task and given the way HTTP works it would never be perfect.
That said you can make this harder for the leechers, checking the referer is an easy technique to implement, but also easy to get around. Maybe trying things like dynamicially generating URLs which only remain valid for a short time would be harder on the leechers, but also harder on you and probably your site. |
What you say is true, concerning "protecting files" in general, though one can resort to secure channels and encryption. The OP has expressed an interest in preventing hot-linking. This is an issue of file protection as well as preventing theft of bandwidth. The solution is to prevent access to the directory containing the files in question from locations other than the site/server belonging to the owner. It is not difficult. The files are still accessible to the site/server for distribution in an authorized or permissable manner. This is not an arcane problem. The issue has been addressed countless time. There is a record of all that at the fingertips of one's browser (didn't know browsers had fingers, did ya?).
|
I don't know if this idea helps or that it could even be implemented in PHP, but you could encase the file in some sort of executable that would have to communicate with your server ensuring that the license hasn't already been activated (kinda like a registration/activation via the net). Also, you could deactivate text highlighting on the pdf file, which I believe is possible with Adobe Pagemaker.
|
| All times are GMT -5. The time now is 12:24 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC