{"comment":{"created_at":"2011-10-17T23:05:14Z","body":"FWIW, I have found that I get better results with this current monkey path.\r\n\r\n```ruby\r\ndef fog_file\r\n  (@options.fog_file || {}).reverse_merge :content_type => content_type.to_s\r\nend\r\n```\r\n\r\nI think a patch for content_type should work off off the attachment object.\r\n","updated_at":"2011-10-17T23:05:14Z","url":"https://api.github.com/repos/thoughtbot/paperclip/issues/comments/2435973","id":2435973,"user":{"gravatar_id":"802f7b7813d7c349a84d444d43cb31ee","avatar_url":"https://secure.gravatar.com/avatar/802f7b7813d7c349a84d444d43cb31ee?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/metaskills","id":2381,"login":"metaskills"}},"action":"created","issue":{"number":551,"created_at":"2011-08-10T16:44:30Z","pull_request":{"diff_url":"https://github.com/thoughtbot/paperclip/pull/551.diff","patch_url":"https://github.com/thoughtbot/paperclip/pull/551.patch","html_url":"https://github.com/thoughtbot/paperclip/pull/551"},"body":"When uploading attachment thumbnails to Rackspace CloudFiles, I've had a problem with the content-type of the thumbnails being set to \"application/json\".  By sending a content_type argument to fog's #create method, this behavior seems to be corrected.\r\n\r\nUnfortunately, I'm having a tough time figuring out how to write a test for this, since the content_type of all files returned by mocked Fog file objects seems to be nil.  Any assistance here would be welcome.  I've included my prospective tests to be included in fog_test.rb here:\r\n\r\n    context \"image with thumbnail\" do\r\n      setup do\r\n        rebuild_model(\r\n          :path   => \":attachment/:basename_:style.:extension\",\r\n          :styles => { :thumb => '50x50>' }\r\n        )\r\n        @file = File.new(File.join(File.dirname(__FILE__), 'fixtures', '5k.png'), 'rb')\r\n        @dummy = Dummy.new\r\n        @dummy.avatar = @file\r\n        @dummy.save\r\n        @files = @connection.directories.get(@fog_directory).files\r\n      end\r\n\r\n      teardown do\r\n        @file.close\r\n        directory = @connection.directories.new(:key => @fog_directory)\r\n        directory.files.each {|file| file.destroy}\r\n        directory.destroy\r\n      end\r\n\r\n      should \"save file and its thumbnail\" do\r\n        assert_equal 2, @files.size\r\n      end\r\n\r\n      should \"set the correct mime type for all versions of file\" do\r\n        @files.each do |file|\r\n          assert_equal @dummy.avatar.content_type, file.content_type\r\n        end\r\n      end\r\n    end\r\n\r\nThanks...","comments":6,"title":"Provide content-type of file to fog storage provider.","updated_at":"2011-10-17T23:05:14Z","url":"https://api.github.com/repos/thoughtbot/paperclip/issues/551","id":1381076,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"ac5ed5f4f1cf5034f99caaa803f6d037","avatar_url":"https://secure.gravatar.com/avatar/ac5ed5f4f1cf5034f99caaa803f6d037?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jmcnevin","id":12859,"login":"jmcnevin"},"html_url":"https://github.com/thoughtbot/paperclip/issues/551","labels":[],"state":"open"},"legacy":{"issue_id":1381076,"comment_id":2435973}}