Change the location of the paperclip tmp files

Is it possible to move ( /tmp/stream*

) tempfiles generated with paperclip to a different location, for example /railsapp/public/tmp

without changing the tmpfiles for the whole application environment? I would like to show a preview of the uploaded file if validation fails in the model.

+2


a source to share


2 answers


Saving downloads in Paperclip is such a problem. However, I used this module: http://ryantownsend.co.uk/articles/storing-paperclip-file-uploads-when-validation-fails.html along with https://github.com/formasfunction/remotipart



You can now do an Ajax file upload and save / view the image if something fails.

+1


a source


This is not a paperclip setting. It just uses the file webserver it got from the user.

You need to set this at the web server level. If you are using Apache and Passenger, you will most likely want to set this parameter:



http://www.modrails.com/documentation/Users%20guide.html#_passengertempdir_lt_directory_gt

+2


a source







All Articles