Ruby on rails send_文件可以工作,但不允许用户指定目标文件名/文件夹
在我的rails应用程序中,我允许用户下载文件 def download options = { :filename => @file_name, :type => 'application/zip', :disposition => 'attachment' } send_file(@path, options) end def下载 选项={:filename=>@file_name,:type=>'application/zip',:disposition=>'attachment'} 发送_文件(@path,options) 结束Ruby on rails send_文件可以工作,但不允许用户指定目标文件名/文件夹,ruby-on-rails,Ruby On Rails,在我的rails应用程序中,我允许用户下载文件 def download options = { :filename => @file_name, :type => 'application/zip', :disposition => 'attachment' } send_file(@path, options) end def下载 选项={:filename=>@file_name,:type=>'application/zip',:disposition=>'attachment'
这将起作用,用户将看到一个打开或保存文件对话框。但是,用户从未有机会为下载的文件指定文件名或目标文件夹。有没有一种方法可以让我使用rails标准的send_file实现这种额外的灵活性?您必须在浏览器上设置这些设置