Basic CHMOD restriction

Posted by Marshall Mathews on Stack Overflow See other posts from Stack Overflow or by Marshall Mathews
Published on 2012-03-28T22:51:20Z Indexed on 2012/03/28 23:29 UTC
Read the original article Hit count: 287

i have an uploads folder on my website. What i want to do is restrict users from accessing like i dont want them to go to www.mysite.com/uploads/ and see the files in there and it should show forbidden, but they should be able to download via my website, for example www.mysite.com/downloads.php?id=1

If thats not possible, how can i atleast not show them the directory index on /uploads

How is it that file sharing websites does this?

An htaccess with

deny from all

stops php from accessing the file as well
Please tell me a solution if you would know, i googled and asked on irc a few days ago about this issue, its pretty confusing to me.

© Stack Overflow or respective owner

Related posts about php

Related posts about .htaccess