Browse Source

推送文件到云集存储完成

Former-commit-id: e35fb35fe3
pull/9/head
zhangwei 2 years ago
parent
commit
1a759c39a3
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      adaptor/PCM-CORE/api/internal/handler/image/chunkhandler.go

+ 8
- 1
adaptor/PCM-CORE/api/internal/handler/image/chunkhandler.go View File

@@ -96,10 +96,17 @@ func ChunkHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
} }


func uploadStorage(svcCtx *svc.ServiceContext, name string) error { func uploadStorage(svcCtx *svc.ServiceContext, name string) error {
svcCtx.Uploader.Upload(&s3manager.UploadInput{
fileInfo, err := os.Open(filepath.Join(uploadPath, name))
upload, err := svcCtx.Uploader.Upload(&s3manager.UploadInput{
Bucket: aws.String("pcm"), Bucket: aws.String("pcm"),
Key: aws.String(name), Key: aws.String(name),
Body: fileInfo,
}) })

if err != nil {
return err
}
println(upload.UploadID)
return nil return nil
} }




Loading…
Cancel
Save