SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru rockit's Avatar
    Join Date
    Sep 2005
    Location
    Canada
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Restrict Directory to Public

    Need some assistance on creating a directory for files that can be downloaded once a permission level has been granted to the end user.

    the only issue is, it can't reside in the public directory or else and soon as someone finds that directory, they can directly access those files.

    this is sort of related to the Binary Thread from earlier, but would like some good input on how to restrict such a directory.

    if i place the files in a directory outside the public directory, then how would that directory be accessed by php?

  2. #2
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    readfile, or something in that family.
    Code PHP:
    <?php if $user->can_read($file_location) { readfile($file_location) } ?>
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  3. #3
    SitePoint Guru rockit's Avatar
    Join Date
    Sep 2005
    Location
    Canada
    Posts
    636
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ya, i have to create a folder outside of the public directory for it to be truly accessible but i'm not sure how i can access the folder through php. i'm working off of a shared server.


Bookmarks

Posting Permissions

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