-1

I've uploaded a file using active_scaffold and paperclip, passing through update action, but don't know how to extract the params

How am I supposed to get the origin_filename? There are some keyword converting problem so I have to show it by image.

Here is what I tried:

params[:excel].tempfile
params[:excel].original_filename 
params[:excel][:filename]

The params content:

enter image description here

Bartłomiej Semańczyk
  • 59,234
  • 49
  • 233
  • 358
CoolDrinE
  • 11
  • 7
  • 1
    Please to not link screenshots, paste the text directly into the question. That makes it easier to read and understand your question. And the question with its answers easier to find by other with the same problem. – spickermann Nov 27 '15 at 09:43
  • Thanks, not quite handy on editing format. I will try make it better next time, from now on – CoolDrinE Nov 28 '15 at 06:53

1 Answers1

0

You are almost there, but your file is nested in params[:record]:

file = params[:record][:excel]
file.original_filename

Further read: Rails Guide about uploading files

spickermann
  • 100,941
  • 9
  • 101
  • 131