Add the authors to the download filename
This commit is contained in:
parent
c82fd09e0d
commit
94c75b1d2a
1 changed files with 1 additions and 1 deletions
|
@ -117,7 +117,7 @@ func downloadHandler(h handler) {
|
|||
|
||||
headers := h.w.Header()
|
||||
headers["Content-Type"] = []string{"application/epub+zip"}
|
||||
headers["Content-Disposition"] = []string{"attachment; filename=\"" + book.Title + ".epub\""}
|
||||
headers["Content-Disposition"] = []string{fmt.Sprintf("attachment; filename=\"%s - %s.epub\"", strings.Join(book.Authors, ", "), book.Title)}
|
||||
headers["Content-Length"] = []string{fmt.Sprint(book.FileSize)}
|
||||
headers["Last-Modified"] = []string{fmt.Sprint(book.UploadDate.Format(time.RFC1123))}
|
||||
addCacheControlHeader(h.w, false)
|
||||
|
|
Reference in a new issue