title: Ruby on Rails upload file problem odd utf8 conversion error
body: <p>I am trying to upload a file and i am getting the following error:</p>
  
  <pre><code>"\xFF" from ASCII-8BIT to UTF-8
  </code></pre>
  
  <p>I am pretty much following the rails guides in what they are doing. Here is the code I am using.</p>
  
  <pre><code>file = params[:uploaded_file]
  
  File.open(Rails.root.join('public', 'images', file.original_filename), 'w') do |f|
    f.write(file.read)
  end
  </code></pre>
  
  <p>I don't get why it doesn't work. What am I doing wrong?</p>
  
  <p>Update -- Here is the application Trace</p>
  
  <pre><code>app/controllers/shows_controller.rb:16:in `write'
  app/controllers/shows_controller.rb:16:in `block in create'
  app/controllers/shows_controller.rb:15:in `open'
  app/controllers/shows_controller.rb:15:in `create'
  </code></pre>