aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoni Sawicki <tenox@google.com>2022-06-20 01:21:27 -0700
committerAntoni Sawicki <tenox@google.com>2022-06-20 01:21:27 -0700
commit6c5d047896e1ab88b041ac4b94e13dc9fed463d9 (patch)
treecd573fff324df8dd557ab741a46c39c6a0f2aa2c
parent6db3ca4ed535e011a79ca847d2f88d95beacf06c (diff)
downloadwfm-6c5d047896e1ab88b041ac4b94e13dc9fed463d9.tar.gz
disp inline provide filename hint
-rw-r--r--fileio.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/fileio.go b/fileio.go
index 7d3af72..1d1ba9e 100644
--- a/fileio.go
+++ b/fileio.go
@@ -72,7 +72,7 @@ func dispInline(w http.ResponseWriter, uFilePath string) {
fi.Close()
w.Header().Set("Content-Type", mt.String())
- w.Header().Set("Content-Disposition", "inline")
+ w.Header().Set("Content-Disposition", "inline; filename=\""+url.QueryEscape(filepath.Base(uFilePath))+"\";")
w.Header().Set("Content-Length", fmt.Sprint(f.Size()))
w.Header().Set("Cache-Control", *cacheCtl)
streamFile(w, uFilePath)