is there any code that help me to anti leech for my files or

Discussion in 'PHP' started by ironmankho, Feb 27, 2009.

  1. #1
    i want to host my files on my server .... but i want to prevent form leecher that my files direct links to their server ......

    for example : www.mysite.com/myfile.rar

    it is very easy to share this link ......but any solution ..that give me security ...that always user come to my site and download this file ....

    what idea about referral code OR .httacces code
     
    ironmankho, Feb 27, 2009 IP
  2. w0tan

    w0tan Peon

    Messages:
    77
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can use .htaccess to restrict access to users that are using your domain. example of that here

    Nothing is 100% though. Referral headers can be spoofed easily--as can most other things you'd use to protect your files.
     
    w0tan, Feb 27, 2009 IP
  3. ironmankho

    ironmankho Active Member

    Messages:
    393
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #3
    Thanks for this hint ....
     
    ironmankho, Feb 28, 2009 IP
  4. mexabet

    mexabet Well-Known Member

    Messages:
    866
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    108
  5. BMR777

    BMR777 Well-Known Member

    Messages:
    145
    Likes Received:
    8
    Best Answers:
    1
    Trophy Points:
    140
    #5
    For the most security you could do something like give links such as down.php?id=12 which corresponds to a database entry for the file in your DB. Then you could have the files really hosted at yoursite.com/uploads/randomfilename.ext and then users would have to call the file at the down.php?id=12 or something URL.

    Then the down.php could check and see if you want to give the file, such as if they are logged in or not, the referring url, etc. :)
     
    BMR777, Feb 28, 2009 IP
  6. ironmankho

    ironmankho Active Member

    Messages:
    393
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    55
    #6
    Thanks for giving me these useful hints and links
     
    ironmankho, Mar 1, 2009 IP