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))
|
err = r.ParseMultipartForm(int64(sizelimit))
|
||||||
if err != nil {
|
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
|
return
|
||||||
}
|
}
|
||||||
file, header, err := r.FormFile("file")
|
file, header, err := r.FormFile("file")
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<pre id="responses"></pre>
|
<pre id="responses"></pre>
|
||||||
<form id="uploadForm" class="dropzone" method="POST" action="{{.Prefix}}/api/upload/{{.Share.Name}}">
|
<form id="uploadForm" class="dropzone" method="POST" action="{{.Prefix}}/api/upload/{{.Share.Name}}"
|
||||||
<noscript>
|
enctype="multipart/form-data"> <noscript>
|
||||||
<input type="file" name="file" />
|
<input type="file" name="file" />
|
||||||
</noscript>
|
</noscript>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in a new issue