0

I am having production server and database is from aws. I visit remote machine using pem file & start rails console.

I have particular invitee (from Invitee model) & have following column to store image using 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)

I want to upload image at https://i.stack.imgur.com/PBVCX.jpg by using rails console production. How can I do this?

Input I can have is, image url and object of invitee for which profile_pic columns to be updated.

I have image in my local machine but I cannot upload it from local to remote so using https://imglur.com

ray
  • 5,454
  • 1
  • 18
  • 40

1 Answers1

0

I suggest you to check another answer "Save image from URL by paperclip " which does what you want to achieve. Check code snippet: self.profile_pic = open(url) will upload the picture to your model. Your picture real URL is https://i.stack.imgur.com/umhSI.png

Mike S
  • 324
  • 1
  • 10