mirror of
https://github.com/hay-kot/homebox.git
synced 2024-12-19 05:26:31 +00:00
handle parse form error
This commit is contained in:
parent
7db55ef1a5
commit
ab376134b9
1 changed files with 6 additions and 1 deletions
|
@ -154,7 +154,12 @@ func (ctrl *V1Controller) HandleItemsImport() http.HandlerFunc {
|
|||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Max upload size of 10 MB - TODO: Set via config
|
||||
r.ParseMultipartForm(10 << 20)
|
||||
err := r.ParseMultipartForm(10 << 20)
|
||||
if err != nil {
|
||||
log.Err(err).Msg("failed to parse multipart form")
|
||||
server.RespondServerError(w)
|
||||
return
|
||||
}
|
||||
|
||||
file, _, err := r.FormFile("csv")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue