handle parse form error

This commit is contained in:
Hayden 2022-09-09 10:22:51 -08:00
parent 7db55ef1a5
commit ab376134b9

View file

@ -154,7 +154,12 @@ func (ctrl *V1Controller) HandleItemsImport() http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) { return func(w http.ResponseWriter, r *http.Request) {
// Max upload size of 10 MB - TODO: Set via config // 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") file, _, err := r.FormFile("csv")
if err != nil { if err != nil {