# Save image from url to blob

**URL:** <https://www.ruby-forum.com/t/save-image-from-url-to-blob/183405>\
**Category:** Rails\
**Created:** [February 13, 2010, 6:07am UTC](https://www.ruby-forum.com/t/save-image-from-url-to-blob/183405 "2010-02-13T06:07:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Frank\_in\_Tennessee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/dec6dc/32.png) [@Frank\_in\_Tennessee](https://www.ruby-forum.com/u/Frank_in_Tennessee)\
**Post date:** [February 13, 2010, 6:07am UTC](https://www.ruby-forum.com/t/save-image-from-url-to-blob/183405/1 "2010-02-13T06:07:50Z")

</div>

Hello,

I would like to save jpg images from urls similar to the one below to  
a field defined as a blob, but I am not sure how to code it.

![image 15943-0](http://images.mywebsite.com/5f52f047f131d.jpg)

Is this how it should be coded if the url was extracted?

image\_file = Image.new  
image\_file.blob\_image\_field = open([http://images.mywebsite.com/](http://images.mywebsite.com/)  
5f52f047f131d.jpg)  
image\_file.save

Thanks,

Frank
