I've tried to find the documentation file handling in Rails, without success. Here's the link to the File class (specified by the docs for file_filed_tag): http://api.rubyonrails.org/classes/File.html
I figure there's got to be a better set of source docs. My main question is about where can I save a file that is not publicly accessible. I'm interested in using file uploaded files temporarily for "wizard" like purposes for users.
The Rails documentation only mentions this in passing The source that handles uploads is https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/http/upload.rb
You could use the gem "paperclip" to handle the file upload for you:
https://github.com/thoughtbot/paperclip
It is conventional to store your uploaded files in public/system, the default configuration in paperclip is:
:rails_root/public/system/:class/:attachment/:id_partition/:style/:filename
but you can change it to another main folder if you want to keep it out of public:
:rails_root/private/:class/:attachment/:id_partition/:style/:filename
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With