1、问题代码
views :
<%= file_field_tag "attachment", :accept => 'application/msexcel'%>
controller:
att_file = params[:attachment].read
att_file_name = params[:attachment].original_filename
File.open("public/attachment_file", "wb") do |f|
f.write(xx)
end
2、问题
Permission denied - public/attachment_file
第一次做这种关于文件上传,不太知道这类错误的原因,还请大家帮忙~!!!