Paperclip: upload from url with extension

余生颓废 提交于 2019-12-03 02:14:38

Good timing. I just sent a pull request that was patched in a few hours ago (Jul 20 2012) which should make your life real easy.

self.asset = URI.parse("http://s3.amazonaws.com/blah/blah/blah.jpg")

This will download your jpeg image, ensure that the filename is blah.jpg and the content type is 'image/jpg'

Paperclip version > 3.1.3 (you'll need to link it to github repo until it gets released).

UPDATE: confirmed working with paperclip version >= 3.1.4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!