diff --git a/biz/attachment.go b/biz/attachment.go index 8edf2b8..e5f80fa 100644 --- a/biz/attachment.go +++ b/biz/attachment.go @@ -213,7 +213,6 @@ func (s *AttachmentAPIService) UploadDocument(ctx *gin.Context) { attachment, err := s.saveFile(ctx, fileheader, true) if err != nil { - os.Remove("." + attachment.Path) ctx.JSON(http.StatusInternalServerError, ginResponse{Code: http.StatusInternalServerError, Message: err.Error(), Error: err.Error()}) return } @@ -310,7 +309,6 @@ func (s *AttachmentAPIService) UploadArticle(ctx *gin.Context) { attachment, err := s.saveFile(ctx, fileHeader) if err != nil { s.logger.Error("saveFile", zap.Error(err)) - os.Remove("." + attachment.Path) ctx.JSON(http.StatusOK, map[string]interface{}{"errno": 1, "msg": err.Error()}) return }