Question: I'm using ruby 1.9.2 along with Rails 3.1.4 and Paperclip 2.4.5.

My issue is trying to save a paperclip attachment from a URI loses the file extension and saves the file without one resulting in issues with things like fancybox that require an extension.

Some example code:

```
uri = "http://featherfiles.aviary.com/2012-06-13/bbe5f0de1/0c5a672b88ea47ecb4631ac173e27430.png"
open(uri)
#=> #<File:/var/folders/zc/d69gxhzx10x_bvjrkqgyjgxr0000gn/T/open-uri20120613-27204-i6cldv>

```

Because there is no extension on the temp file paperclip is saving the file without one resulting in issues.

Has anyone run into this issue? I've seen multiple answers about using paperclip to store images from a URI but none seem to address the same problem we're running

Answer: 
Im not sure if this will help in your case, but I was noticing similar issues in my project. 

The issue turned out to be not caused by `Paperclip` nor `open-uri`, but the receiver of the paperclip file (in my case `Spree Commerce`). Check that you are assigning the paperclip object to the right object, and that it is being interpreted correctly. 

The fix that worked for me was to change:

```
@product.images << Spree::Image.create({ 
    :attachment => open(image_url) 
}, :without_protection => true)

```

to

```
@product.master.images << Spree::Image.create({ 
    :attachment => open(image_url) 
}, :without_protection => true)

```

Good luck with your issue
Yes, it is a problem but we can get around this with fancybox.

In the link tag(for image) add `:type => 'image'`

```
- @images.each do |image|
 = link_to image_tag(image.attachment.url),   image.attachment.url, class: "fancybox", type: 'image'

```

By specifying 'type', Fancybox overrides the type as image

<https://groups.google.com/forum/?fromgroups=#!topic/fancybox/QgjquBCLynU>