From 189676b377f842f1833ee9055ee6529f4349b178 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Fri, 9 Oct 2009 00:55:42 +0000 Subject: [PATCH] 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 --- core/src/main/java/hudson/model/Slave.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 734b386029..36d6aa2063 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -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(); -- GitLab