undefined method `original_filename' for String
问题 I'm trying to implement a csv upload functionality WITHOUT using gems such as paperclip . Here's the view: %h1 Add Users From CSV = form_tag(:action => "upload",:multipart => true,:method => :post) do = file_field_tag 'csv' = submit_tag 'Upload' And here's the controller: 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 => "Successfully uploaded csv!" end But I