{"comment":{"created_at":"2011-10-21T19:15:09Z","body":"The rack-raw-upload patch forces UTF-8 encoding for the uploaded file type\r\n\r\n    env['rack.input'].each do |chunk|                   # Fixes Encoding::UndefinedConversionError\r\n       tempfile << chunk.force_encoding('UTF-8')\r\n    end\r\n\r\nI think the returned value of 'MIME::Types.type_for(params[:file].original_filename)' from the file uploaded via rack-raw-uploader is not something Paperclip agrees with, hence the papaerclip error. I'll try to force the encoding to paperclip, for a  quick fix and see how it works.","updated_at":"2011-10-21T19:15:09Z","url":"https://api.github.com/repos/bastiaanterhorst/rich/issues/comments/2485109","id":2485109,"user":{"gravatar_id":"36a36d7bb3872e3f7c9d42241fa2e398","avatar_url":"https://secure.gravatar.com/avatar/36a36d7bb3872e3f7c9d42241fa2e398?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/v3rt1go","id":148487,"login":"v3rt1go"}},"action":"created","issue":{"number":1,"created_at":"2011-10-21T16:40:20Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"When I try to upload a file using the embedded uploader, the file doesn't get saved in the db and I get this error in the console:\r\n\r\n    Encoding::UndefinedConversionError (\"\\xFF\" from ASCII-8BIT to UTF-8)\r\n\r\nFrom what I can see it's something similar to the html5 upload bug, that was fixed here https://github.com/galetahub/ckeditor/issues/8 \r\nI tried to temper with the gem and make the fix myself, but to no success.\r\n\r\nI'm running rails3.1 on ruby 1.9.2-p290. ActiveAdmin 0.3.2 ( ebeigarts's fork) to make it work with formtastic 2 from here: https://github.com/mak-it/active_admin\r\n\r\nThanks a bunch!\r\n","comments":5,"title":"files won't upload using the rich uploader","updated_at":"2011-10-21T19:15:10Z","url":"https://api.github.com/repos/bastiaanterhorst/rich/issues/1","id":2017266,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"36a36d7bb3872e3f7c9d42241fa2e398","avatar_url":"https://secure.gravatar.com/avatar/36a36d7bb3872e3f7c9d42241fa2e398?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/v3rt1go","id":148487,"login":"v3rt1go"},"html_url":"https://github.com/bastiaanterhorst/rich/issues/1","labels":[],"state":"open"},"legacy":{"issue_id":2017266,"comment_id":2485109}}