![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2006
Posts: 16
Rep Power: 0
![]() |
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. |
|
|
|
|
|
#2 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Protect the directory. Google for "hot linking."
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#3 |
|
Programming Guru
![]() ![]() ![]() |
If you have your own host with Apache running... you could block access to only those you want to allow in with .htaccess files.
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#4 |
|
Newbie
Join Date: Apr 2006
Posts: 16
Rep Power: 0
![]() |
and how do I let others download then from within my site?
|
|
|
|
|
|
#5 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#6 |
|
Newbie
Join Date: Aug 2005
Posts: 12
Rep Power: 0
![]() |
I've googled for some solutions.
I see they check the REFERER, but it can be faked. How is it fixed? |
|
|
|
|
|
#7 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#8 |
|
Hobbyist Programmer
Join Date: Jun 2006
Location: Ireland
Posts: 152
Rep Power: 3
![]() |
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.
__________________
Visit my website BinaryNotions. |
|
|
|
|
|
#9 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
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?).
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#10 |
|
King of Portal
|
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.
__________________
Lo, there do I see my father. 'Lo, there do I see My mother, and my sisters, and my brothers. 'Lo, there do I see The line of my people... Back to the beginning. 'Lo, they do call to me. They bid me take my place among them. In the halls of Valhalla... Where the brave... May live... ...forever.. GrimBB | Mimesis |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| OnlineTextEditor.Com! | Sane | Show Off Your Open Source Projects | 43 | Jun 16th, 2006 8:55 AM |
| Command Prompt | SkyPioneer | Coder's Corner Lounge | 5 | May 3rd, 2006 10:07 PM |
| add mutiple users to the smbpasswd file. | Pizentios | Bash / Shell Scripting | 3 | Oct 20th, 2005 12:48 PM |
| After execution - Error cannot locate /Skin File? | wchar | Visual Basic | 1 | Mar 5th, 2005 9:04 PM |
| airport Log program using 3D linked List : problem reading from file | gemini_shooter | C++ | 0 | Mar 2nd, 2005 4:12 PM |