title: undefined method `original_filename' for String
body: <p>I'm trying to implement a csv upload functionality WITHOUT using gems such as <code>paperclip</code>. Here's the view: </p>
  
  <pre><code> %h1 Add Users From CSV
   = form_tag(:action =&gt; "upload",:multipart =&gt; true,:method =&gt; :post) do
     = file_field_tag 'csv'
     = submit_tag 'Upload'
  </code></pre>
  
  <p>And here's the controller: </p>
  
  <pre><code>def upload
    csv_io = params[:csv]
  
    File.open(Rails.root.join('public', 'uploads', csv_io.original_filename), 'wb') do |file|
      file.write(csv_io.read)
    end
  
    redirect_to root_path, :notice =&gt; "Successfully uploaded csv!"
  end
  </code></pre>
  
  <p>But I got this error message when I'm uploading a csv called <code>data.csv</code></p>
  
  <pre><code>undefined method `original_filename' for "data.csv":String
  </code></pre>
  
  <p>I just followed the official Rails guide, but it's still getting error. Can anyone suggest some solutions? </p>
  
  <p>NOTE: I just need to read data from the csv file and it does not need to be saved persistently on server. </p>