From 9aa70a7c44caf7134da1a9006611f50d3b8758e1 Mon Sep 17 00:00:00 2001 From: elmiomar Date: Fri, 29 Mar 2024 02:51:46 -0400 Subject: [PATCH] add 'attachment;' to the Content-Disposition header --- .../java/gov/nist/oar/distrib/web/DatasetAccessController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/gov/nist/oar/distrib/web/DatasetAccessController.java b/src/main/java/gov/nist/oar/distrib/web/DatasetAccessController.java index 947216d8..6f88f9ee 100644 --- a/src/main/java/gov/nist/oar/distrib/web/DatasetAccessController.java +++ b/src/main/java/gov/nist/oar/distrib/web/DatasetAccessController.java @@ -493,7 +493,7 @@ public void downloadFile(String dsid, String filepath, String version, HttpServl response.setHeader("Content-Length", Long.toString(sh.getInfo().contentLength)); response.setHeader("Content-Type", sh.getInfo().contentType); response.setHeader("Content-Disposition", - "filename=\"" + Pattern.compile("/+").matcher(filepath).replaceAll("_") + "\""); + "attachment;filename=\"" + Pattern.compile("/+").matcher(filepath).replaceAll("_") + "\""); int len; byte[] buf = new byte[100000];