In download my uploadsfolder in directory is open,and every body can see this

hi
i have problem,i gave every one link for download,they follow the link for download ,but when user is going to folder,user can see all of files in directory an can switch bitween folders,

what is solution?

1 Like

I’m not entirely sure if I understand what you mean, but if you mean that visitors get an index listing and if you’re running Apache you could add the following to your .htaccess file

<IfModule mod_autoindex.c>
    Options -Indexes
</IfModule>
2 Likes

Thanks,

1 Like

Of course you can remove the if statement from that once you know it works.

2 Likes

I recommend you to move the folder away from the “public”, so it will not be accessible. If you bump into a folder that gives you a forbidden message you will be curious about the content. It’s better if the folder does not exist :smile: If it’s something sensitive you can get the content with PHP.

LE: To complete my answer, google may index files from your folder and you cannot restrict the download unless you deny the access; in this case, there is no point to keep the folder public, just make all downloads available through a PHP script that serves files by request (if the user has access and any other restrictions you need).

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.