FIX specify upload enctype

This commit is contained in:
boyska 2018-01-05 23:39:41 +01:00
parent e62f7f5840
commit a6d5ca9141
2 changed files with 4 additions and 3 deletions

View file

@ -156,7 +156,8 @@ func (mu *MegaUploader) upload(w http.ResponseWriter, r *http.Request) {
}
err = r.ParseMultipartForm(int64(sizelimit))
if err != nil {
http.Error(w, "Bad request", http.StatusBadRequest)
fmt.Fprintln(os.Stderr, err)
http.Error(w, "Bad request: error parsing form", http.StatusBadRequest)
return
}
file, header, err := r.FormFile("file")

View file

@ -23,8 +23,8 @@
</ul>
</div>
<pre id="responses"></pre>
<form id="uploadForm" class="dropzone" method="POST" action="{{.Prefix}}/api/upload/{{.Share.Name}}">
<noscript>
<form id="uploadForm" class="dropzone" method="POST" action="{{.Prefix}}/api/upload/{{.Share.Name}}"
enctype="multipart/form-data"> <noscript>
<input type="file" name="file" />
</noscript>
</form>