FIX specify upload enctype
This commit is contained in:
parent
e62f7f5840
commit
a6d5ca9141
2 changed files with 4 additions and 3 deletions
3
http.go
3
http.go
|
@ -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")
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue