开发者

send_file works but does not let user specify target filename/folder

开发者 https://www.devze.com 2023-01-20 17:12 出处:网络
In my rails application I letting users download files def download options = { :filename => @file_name, :type => \'application/zip\', :disposition => \'attachment\' }

In my rails application I letting users download files

def download
  options = { :filename => @file_name, :type => 'application/zip', :disposition => 'attachment' }
  send_file(@path, option开发者_Go百科s)
end

This works and user sees an Open or Save File dialog. However user is never given a chance to specify neither file name nor a target folder for the downloaded file. Is there a way I can allow this additional flexibility using rails standard send_file?


Those settings you have to set up on your browser.

0

精彩评论

暂无评论...
验证码 换一张
取 消