Upload Text File into a string


I’m trying to upload a text file from a form and read the file into a
string in my rails app. I’ve tried using @import_file =
File.read(params[:import_file]) as well as File.open, but I need getting
“cannot convert StringIO into String” errors. Anyone have any ideas?

  • Kyle


Have you tried

@import_file = params[‘import_file’].read