I want to upload files in my web app in such way that only owner can see urls by default, and it is impossible to download alien file knowing its name/upload date/hash etc. But also it is important to keep original filenames when user uploads file.

Now I have idea about storing each file in separate directory with random name:


For example:


It looks very easy and secure because it is practically impossible to found random uuid, but I am worried about performance and filesystem limits. I have the ext4 filesystem on rota server drive. So the question - is it ok to store each file in the separate directory? Is it possible to store 1000 - 2000 files with such approach without performance issues?

1 Answer 1


Solved main task with another way - add random uuid to file name (e.g. /media/2016/11/18/a1b24567184c-filename.ext) and cut it when serving file in nginx using Content-Disposition header. So main question still is doubtful

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .