This commit is contained in:
withchao
2023-03-29 11:17:16 +08:00
parent 5edcb9908d
commit 73747e0b38
4 changed files with 37 additions and 22 deletions
+4 -1
View File
@@ -379,7 +379,10 @@ func (c *s3Database) GetUrl(ctx context.Context, req *third.GetUrlReq) (*third.G
if err != nil {
return nil, err
}
opt := obj.HeaderOption{Filename: info.Name, ContentType: info.ContentType}
opt := obj.HeaderOption{ContentType: info.ContentType}
if req.Attachment {
opt.Filename = info.Name
}
u, err := c.obj.PresignedGetURL(ctx, hash.Bucket, hash.Name, time.Duration(req.Expires)*time.Millisecond, &opt)
if err != nil {
return nil, err