I\'m maintaining a Rails app that has content in the public/ folder that will now need to be protected by a login. We\'re considering moving those folders of files into a p
Making the file available at an unpredictable URL is a simple solution currently used in some production systems.
E.g.: GitLab. The following image was uploaded to an issue of a private repository, https://gitlab.com/cirosantilli/test-private/issues/1, but you can still see it:

Note the unguessable 90574279de prefix automatically added to the URL.
Bitbucket (non-Rails) also uses this technique.