summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
Diffstat (limited to 'api')
-rw-r--r--api/file.go7
-rw-r--r--api/templates/error.html2
2 files changed, 5 insertions, 4 deletions
diff --git a/api/file.go b/api/file.go
index 7dcfc691f..5c983ea55 100644
--- a/api/file.go
+++ b/api/file.go
@@ -419,12 +419,13 @@ func getFile(c *Context, w http.ResponseWriter, r *http.Request) {
ua := user_agent.New(r.UserAgent())
bname, _ := ua.Browser()
+ parts := strings.Split(filename, "/")
+ filePart := strings.Split(parts[len(parts)-1], "?")[0]
+ w.Header().Set("Content-Disposition", "attachment;filename=\""+filePart+"\"")
+
if bname == "Edge" || bname == "Internet Explorer" || bname == "Safari" {
// trim off anything before the final / so we just get the file's name
- parts := strings.Split(filename, "/")
-
w.Header().Set("Content-Type", "application/octet-stream")
- w.Header().Set("Content-Disposition", "attachment;filename=\""+parts[len(parts)-1]+"\"")
}
}
diff --git a/api/templates/error.html b/api/templates/error.html
index 2b6211be2..2f588aead 100644
--- a/api/templates/error.html
+++ b/api/templates/error.html
@@ -1,7 +1,7 @@
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
- <title>{{ .ClientCfg.SiteName }} - Error</title>
+ <title><span class='fa fa-chevron-left'></span>Back - Error</title>
<link rel="stylesheet" href="/static/css/bootstrap-3.3.5.min.css">
<link rel="stylesheet" href="/static/css/jasny-bootstrap.min.css" rel="stylesheet">