Reuse index.html template for file upload

git-svn-id: file:///srv/svn/repo/marisa/trunk@51 d6811dac-2434-b64a-9ddc-f563ab233461
This commit is contained in:
dev
2021-10-20 22:03:58 +00:00
parent 03ca7cb287
commit 16a02e999e
3 changed files with 10 additions and 26 deletions

View File

@@ -204,8 +204,11 @@ func uploaderPost(w http.ResponseWriter, r *http.Request) {
switch r.PostFormValue("output") {
case "html":
data := templatedata{Links: links}
servetemplate(w, "/upload.html", data)
data := templatedata{
Maxsize: humanize.IBytes(uint64(conf.maxsize)),
Links: links,
}
servetemplate(w, "/index.html", data)
case "json":
data, _ := json.Marshal(links)
w.Write(data)