强制要求所有文件直接下载,禁止在线打开
1 2 3 | $HTTP["url"] =~ "^/downloads/.*" { setenv.add-response-header = ( "Content-Disposition" => "attachment" ) } |
指定某个文件直接下载,不在线打开
1 2 3 | $HTTP["url"] =~ "/awesome.png$" { setenv.add-response-header = ( "Content-Disposition" => "attachment; filename="happy.png"") } |
原文链接:https://xiaohost.com/2587.html,转载请注明出处。
评论0