diff --git a/upload.go b/upload.go index 128c3eb..f5e4324 100644 --- a/upload.go +++ b/upload.go @@ -64,6 +64,12 @@ func (a *app) upload(c *fasthttp.RequestCtx) { log.Debug("close temporary file", zap.Error(tmp.Close())) log.Debug("remove temporary file", zap.Error(os.RemoveAll(tmpName))) + + if form == nil { + return + } + + log.Debug("cleanup multipart form", zap.Error(form.RemoveAll())) }() if form, err = c.MultipartForm(); err != nil {