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: 
Extension isn't important for temporary file, but if you want use this file in code or save to another place. You can do it:

```
temp_file = open(params[:url])
def temp_file.original_filename; File.basename(base_uri.path); end

```

Now, you can save this temporary file to permanent space or use it in code; Original filename will be used automatically.
Have you inclued the :extension in your path/url option?

For example:

```
has_attached_file :image,
  ...
  :url  => '/images/highlights/:id_partition/:style_:id.:extension',
  :path => ':rails_root/files/images/highlights/:id_partition/:style_:id.:extension'

```

This will probably solve your problem.
You can force an extension there, but I don't think that's recommended.