I have a problem, I would like to store files outside the public folder using paperclip (to make them private), it would be very simple, just configure the :path option, but to retrieve those files (many of them images) I would need a controller method (ie. get_file), making very slow when you display a list of files with the "thumb" images. I was thinking to use a random name to store the files in the public, some cryptic name with SHA1 or something, how hard would 开发者_StackOverflow中文版it be to access a file.?
As long as you make sure that the directory is never listed and the name is really random (does not depend on the real name) and long enough (16 alphanumeric characters should be ok) this is a feasible and common method to do it.
精彩评论