0

I find it difficult to form my question properly, so apologies in advance. I'm currently building a small web app where users can sign up, log in and upload pictures. These pictures are stored in different directories. I want to be able to lock these directories, so people cannot simply view the entire directory (because it features a picture contest and submissions should remain secret). But I also want the contents to be viewable. I intend to create long filenames within the directory automatically to keep them "safe".

Any thoughts?

Thanks in advance, Lenny

lennyklb
  • 1,307
  • 2
  • 15
  • 32

1 Answers1

1

To disable directory browsing of your files, the simplest way is to add a line to an .htaccess file (if you're using Apache) in a common directory:

Options -Indexes

Source

Alternatively you can add this also to a <Directory> or <Location> section of a vhost entry, but would apply to the entire vhost rather than just a given directory tree.

Community
  • 1
  • 1
Jeff Lambert
  • 24,395
  • 4
  • 69
  • 96