我有生产服务器和数据库来自aws
。我使用pem文件访问远程机器并启动rails console
。
我有特别的邀请者(来自Invitee
模型)并有以下专栏使用paperclip
存储图像
invitee.rb
has_attached_file :profile_pic, {:styles => {:large => "640x640>",
:small => "200x200>",
:thumb => "60x60>"},
:convert_options => {:large => "-strip -quality 90",
:small => "-strip -quality 80",
:thumb => "-strip -quality 80"}
}.merge(INVITEE_IMAGE_PATH)
我想使用https://imgur.com/9a6UzVx在rails console production
上传图片。我怎样才能做到这一点?
输入我可以有,图像网址和被邀请者的对象,其中profile_pic
列要更新。
我在我的本地机器上有图像,但我不能将它从本地上传到远程,所以使用https://imglur.com
我建议你检查另一个答案"Save image from URL by paperclip
"做你想要达到的目标。检查code snippet:self.profile_pic = open(url)
会将图片上传到您的模型。你的图片真实的网址是https://i.imgur.com/9a6UzVx.png