Garbit
Garbit

Reputation: 6036

Deny direct URL request to files in specific folder

Hi there just wondering;

How do I deny direct access to files in a specific folder. I have an upload script that uploads to /uploadedFiles and currently I just have an index.php which redirects the user to the login page. However, how do I stop users from accessing a file directly such as:

/uploadedFiles/thisFile.jpeg

Thanks in advance :)

Upvotes: 0

Views: 793

Answers (1)

Marcel Jackwerth
Marcel Jackwerth

Reputation: 54752

If you do not want your files to be accessed via the webinterface, add a .htaccess file with the following content:

Order deny,allow
Deny from all

Upvotes: 1

Related Questions