文件上传增加错误信息返回

Former-commit-id: 474a2bc77ba597a0e41cc3e5407b776b0dffaf0b
This commit is contained in:
zhangwei 2023-07-06 10:40:41 +08:00
parent 5b10e312d2
commit 597ffb1489
1 changed files with 5 additions and 0 deletions

View File

@ -25,6 +25,11 @@ var uploadTempPath = filepath.Join(uploadPath, "temp")
func UploadHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
file, fileHeader, err := r.FormFile("file")
if err != nil {
logx.Error(err)
result2.HttpResult(r, w, nil, err)
return
}
index := r.PostFormValue("index")
hash := r.PostFormValue("hash")