I want admins to import contacts via csv files into the database. Therefore, I use the ruby ββcsv library and the following code snippet:
if request.post? && params[:file].present? inputFile = params[:file].read CSV.foreach(inputFile) do |row| #save row here end end
However, in CSV.foreach(inputFile) do |row| I get "Errno :: ENAMETOOLONG - the file name is too long" -error, and the error message shows that it uses the entire csv file as the file name.
Does anyone know why he is doing this?
BTW: the csv file uses ',' and '/ n' as delimiters.
source share