File_field_tag: what was the original file name?

My site allows users to upload csv files for processing. Everything works well, but in response, I would like to report something like "Your abc.csv file was processed OK."

Unfortunately, I cannot find the actual source file name in params, although Firebug tells me that this is part of the message.

Any tips?

Thanks....

+3
source share
2 answers

Try using debugging information about the results of your form.

http://guides.rubyonrails.org/debugging_rails_applications.html#debug

+2
source

As Jarrod mentions in the comments above. Use params [: file] .original_filename

, (file1 file2). ActionController:: UploadedTempfile, ActionController:: UploadedStringIO.

, , original_filename.

+2

Source: https://habr.com/ru/post/1710307/


All Articles