# Storing Images in the cloud

**URL:** <https://meta.discourse.org/t/storing-images-in-the-cloud/6779>\
**Category:** Self-hosting\
**Tags:** hosting\
**Created:** [May 21, 2013, 11:56pm UTC](https://meta.discourse.org/t/storing-images-in-the-cloud/6779 "2013-05-21T23:56:32Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![benbeltran](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benbeltran/32/103438_2.png) [@benbeltran](https://meta.discourse.org/u/benbeltran)\
**Post date:** [June 3, 2013, 1:09am UTC](https://meta.discourse.org/t/storing-images-in-the-cloud/6779/5 "2013-06-03T01:09:24Z")

</div>

Hey, I responded in the github issue, but I’ll reply here as well. I haven’t had the time to read up / implement the changes to comply with pull request guidelines. But the fix is basically this:

• Use https for the default endpoint instead of http (imgur no longer accepts http requests)  
• Rewind the file after reading it. (The library in charge of extracting the size needs to read it afterwards, if not rewound it will fail)

As shown here:  
[https://github.com/benbeltran/discourse/commit/967d5b59ab2d43ad17cfb50903ea9a142b67e083](https://github.com/benbeltran/discourse/commit/967d5b59ab2d43ad17cfb50903ea9a142b67e083)

Use file.tempfile for File.size when passing the options, as shown here:  
[https://github.com/benbeltran/discourse/commit/6ab3ef7779e121e11b39ecc8c07c04320dbdf475](https://github.com/benbeltran/discourse/commit/6ab3ef7779e121e11b39ecc8c07c04320dbdf475)

( I assume all of you will have File.size(file) instead of what I have… But I kinda messed up in this commit: [https://github.com/benbeltran/discourse/commit/8604b3714d558e75754b64c8f29caec2338e86e0](https://github.com/benbeltran/discourse/commit/8604b3714d558e75754b64c8f29caec2338e86e0) … Sorry)

I hope this post is helpful.

---

_[View the full topic](https://meta.discourse.org/t/storing-images-in-the-cloud/6779)._
