Reputation: 31
I'm experimenting with PaperClip and like it and it looks to be a good solution for our project. However, we'd like to store the uploaded files in another location on the server (ubuntu) besides the public folder and S3 is not an option. So 2 questions:
1) How to set the path and url to store uploads to another directory in ubunto besides the application root or, 2) How to perhaps store the uploaded files on another LAN server as well.
Thanks in advance to all who reply. After an exhaustive search I was surprised to only see Google results for developers only using either rails_root or S3 for storage in PaperClip. Also, if anyone recommends a better file uploading solution that will meet our needs than by all means please advise on that as well. Thanks again!
Upvotes: 3
Views: 3962
Reputation: 13306
You can simply pass the :path
option to has_attached_file
to any path you desire. The docs talk about this, here: http://rdoc.info/gems/paperclip#Storage
If you mount
some shared LAN storage on your web servers, then you can store them there. You do need a shared filesystem location available to all your app servers, so S3 is a common and easy to setup solution.
Upvotes: 5