[英]I've uploaded a file using active_scaffold and paperclip, passing through update action, but don't know how to extract the params
I've uploaded a file using active_scaffold and paperclip, passing through update action, but don't know how to extract the params我已经使用 active_scaffold 和回形针上传了一个文件,通过更新操作,但不知道如何提取参数
How am I supposed to get the origin_filename?我应该如何获得 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:参数内容:
You are almost there, but your file is nested in params[:record]:您快到了,但是您的文件嵌套在 params[:record] 中:
file = params[:record][:excel]
file.original_filename
Further read:Rails Guide about uploading files进一步阅读:关于上传文件的 Rails 指南
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.