elf 4 months ago
parent 10aeac3e85
commit cede98d7d6

@ -28,9 +28,10 @@ func UploadFile(c *gin.Context) (result.Data, error) {
return nil, errors.NewBusinessError("文件不存在")
}
fmt.Println(filePath, destPath)
fmt.Println(filePath, destPath, isDeleteLocal)
url, err := global.Storage.Upload(filePath, destPath)
if err != nil {
fmt.Println(err.Error())
return nil, err
}
if isDeleteLocal == "1" {

Binary file not shown.

@ -38,7 +38,7 @@ func (s *CosStorage) Upload(filePath, destPath string) (string, error) {
}
_, _, err = client.Object.Upload(
context.Background(), destPath, filePath, nil,
context.Background(), destPath, filePath, &cos.MultiUploadOptions{ThreadPoolSize: 5, PartSize: 30},
)
if err != nil {
return "", err

Loading…
Cancel
Save