akshay1188
akshay1188

Reputation: 1667

Rails paperclip uploading file outside rails app folder

I want to use paperclip plugin to upload the file but the problem is that i have to save the uploaded file outside the rails app folder.

Tried searching it but did not help.

Thanks in advance

Upvotes: 0

Views: 813

Answers (2)

Nate
Nate

Reputation: 21

I haven't tried it myself (yet, but now I'm about to). Perhaps you could place a symbolic link inside of the Rails directory that points to the location outside you want written to.

Upvotes: 0

nunopolonia
nunopolonia

Reputation: 14417

You can use :path to choose where to store the images:

has_attached_file :photo, :path => ":rails_root/public/:class/:attachment/:id/:style_:basename.:extension"

Upvotes: 3

Related Questions