feat: complete upload progress bar

This commit is contained in:
yanghao05
2025-04-17 20:13:12 +08:00
parent 1ca75b6060
commit d961c1a4a5
4 changed files with 27 additions and 49 deletions

View File

@@ -19,8 +19,9 @@ func (c *OSSClient) GetClient() *oss.Client {
func (c *OSSClient) PreSignUpload(ctx context.Context, path string) (*oss.PresignResult, error) {
request := &oss.PutObjectRequest{
Bucket: oss.Ptr(c.config.Bucket),
Key: oss.Ptr("quyun/" + strings.Trim(path, "/")),
Bucket: oss.Ptr(c.config.Bucket),
Key: oss.Ptr("quyun/" + strings.Trim(path, "/")),
ContentType: oss.Ptr("multipart/form-data"),
}
log.Printf("%+v", request)
return c.client.Presign(ctx, request)