title: Why yaml file upload does not work? I think permission problems
body: <p>I would like to load in the config directory, a yaml file chosen by the user.
  I have a view:</p>
  
  <pre><code>&lt;h1&gt;File Upload&lt;/h1&gt;
  &lt;p&gt;Upload your Yaml Configuration File&lt;/p&gt;
  
  &lt;p style="color: green"&gt;&lt;%= flash[:notice] %&gt;&lt;/p&gt;
  
  &lt;%= form_for :uploadFile, :html =&gt; { :multipart =&gt; true } do |f| %&gt;
  
    &lt;label for="upload_file"&gt;Select File:&lt;/label&gt;
    &lt;%= f.file_field :upload %&gt;
    &lt;%= f.submit "Upload", :disable_with =&gt; 'Uploading...' %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>and I have a controller:</p>
  
  <pre><code>class UploadController &lt; ApplicationController
  def uploadFile
      uploaded_io = params[:uploadFile][:upload]
      File.open(Rails.root.join('public', uploaded_io.original_filename), 'w') do |file|
          file.write(uploaded_io.read)
      end
  
      flash.now[:notice]="File has been uploaded successfully"
  
  end
  end
  </code></pre>
  
  <p>When the user selects the file and press "upload" nothing happens and the file is not in the config folder. What can I do? Maybe I should use "import yaml" and load it in a certain way, how?</p>
  
  <p>The log said this: </p>
  
  <pre><code>Started POST "/upload/uploadfile" for 127.0.0.1 at 2012-11-08 10:51:46 +0100
  Processing by UploadController#uploadfile as HTML
    Parameters: {"utf8"=&gt;"âœ“",  "authenticity_token"=&gt;"5FKgZJG4gKPCHXe8OqhFVZL0bu2X9zLR3sxd4ELBulA=", "uploadFile"=&gt;{"upload"=&gt;#&lt;ActionDispatch::Http::UploadedFile:0x3b03ad8 @original_filename="newCases.yml", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"uploadFile[upload]\"; filename=\"newCases.yml\"\r\nContent-Type: application/octet-stream\r\n", @tempfile=#&lt;File:C:/Users/Simo/AppData/Local/Temp/RackMultipart20121108-2664-tb7lxr&gt;&gt;}, "commit"=&gt;"Upload"}
    [1m[35mSetting Load (0.0ms)[0m  SELECT "settings".* FROM "settings" WHERE "settings"."id" = ? LIMIT 1  [["id", 1]]
    Rendered upload/uploadfile.html.erb within layouts/upload (0.0ms)
  Completed 200 OK in 0ms (Views: 0.0ms | ActiveRecord: 0.0ms)
  </code></pre>