提交 189676b3 编写于 作者: K kohsuke

direct the browser to download the data in a certain file name.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@22558 71c3de6d-444a-0410-be80-ed276b4c234a
上级 ee0f1d5b
......@@ -272,7 +272,8 @@ public abstract class Slave extends Node implements Serializable {
URLConnection con = connect();
// since we end up redirecting users to jnlpJars/foo.jar/, set the content disposition
// so that browsers can download them in the right file name.
rsp.setHeader("Content-Disposition", "inline; filename=" + fileName);
// see http://support.microsoft.com/kb/260519 and http://www.boutell.com/newfaq/creating/forcedownload.html
rsp.setHeader("Content-Disposition", "attachment; filename=" + fileName);
InputStream in = con.getInputStream();
rsp.serveFile(req, in, con.getLastModified(), con.getContentLength(), "*.jar" );
in.close();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册