title: Ruby on Rails CSV upload&import - File name too long
body: <p>I want to let admins import contacts via csv files into the database. Therefore I am using the ruby csv library and the following code snippet:</p>
  
  <pre><code> if request.post? &amp;&amp; params[:file].present?
       inputFile = params[:file].read
       CSV.foreach(inputFile) do |row|
           #save row here
       end
   end
  </code></pre>
  
  <p>However in <code>CSV.foreach(inputFile) do |row|</code> I get an "Errno::ENAMETOOLONG - File name too long"-error and the error message shows me that it uses the whole csv file as file name. </p>
  
  <p>Does anyone know why it does that?</p>
  
  <p>BTW: The csv file is using ',' and '/n' as delimiters.</p>