I would like to create a simple file repository in Ruby on Rails. Users have their accounts, and after one logs in they can upload a file or download files previously uploaded.
The issue here is the security. Files should be safe and not available to anyone but the owners.
- Where, in which folder, should I store the files, to make them as safe as possible?
- Does it make sense, to rename the uploaded files, store the names in a database and restore them when needed? This might help avoid name conflicts, though I’m not sure if it’s a good idea.
- Should the files be stored all in one folder, or should they be somewhat divided?
1 Answer