Using "Clip", I want to get an image from a URL, for example:
require 'open-uri'
user.photo = open(url)
The problem is that I am terminating with the file name open-uri20110915-4852-1o7k5uw. Is there a way to change the file name to user.photo?
As an added twist, Paperclip stores my files on S3, so it would be even better if I could set the file name that I want in the original destination, so the images are uploaded to the right S3 key. Something like that:
user.photo = open(url), :filename => URI.parse(url).path
source
share