wangshan 3 rokov pred
rodič
commit
f962ed077a
1 zmenil súbory, kde vykonal 1 pridanie a 0 odobranie
  1. 1 0
      api/internal/logic/uploadlogic.go

+ 1 - 0
api/internal/logic/uploadlogic.go

@@ -33,6 +33,7 @@ func NewUploadLogic(ctx context.Context, svcCtx *svc.ServiceContext, r *http.Req
 
 func (l *UploadLogic) Upload(req *types.UploadReq) (resp *types.CommonRes, err error) {
 	file, fileheader, _ := l.r.FormFile("file")
+	defer file.Close()
 	bt, _ := ioutil.ReadAll(file)
 	t1 := time.Now()
 	upload, err0 := l.svcCtx.Consumer.InfoFileUpload(l.ctx, &consumerinfo.InfoFileUploadReq{