Results 1 to 2 of 2

Thread: Prevent direct access to files in a specific folder ?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2009
    Posts
    968

    Prevent direct access to files in a specific folder ?

    I have a folder on my server that I use to store .zip files that I upload via an upload script on my website. I want to give access to these files to my "registered/logged in" users. How can I deny direct access to the files if someone other than a registered user has a link ?

    For example if a registered user gives a non registered user the download link, how can I prevent the non registered users from downloading that file ?

  2. #2
    Addicted Member Pc Monk's Avatar
    Join Date
    Feb 2010
    Posts
    188

    Re: Prevent direct access to files in a specific folder ?

    check if the session is stored in the computer that is trying to use the link otherwise you need to login ( redirect the user to the login page and after he/she logged in redirect your dear user to the download link again <= incase its not direct
    if its direct theres nothing you can do cause you giving them a direct link and what a direct link mean is direct link you can do some things via cpanel but its too complicated if you ask me to avoid the direct access you have to include some rules in .htaccess that i cant remember right now
    but in my opinion disable any direct download and do it only via php
    GoodDuck
    Last edited by Pc Monk; Jun 30th, 2013 at 08:41 AM.
    Body Language tells the truth! even from the grave tsaeb eht morf gninnur ,nwod deaH
    All the big things started from little! teef my tsap evom sekans ,duol raor slluB
    Lietome.ir

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width