Skip to content

Commit

Permalink
Merge pull request #2176 from Nagarei/fix/s3-ContentDisposition
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Jan 13, 2024
2 parents 13fc698 + 0929bc3 commit 55b5922
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions utils/storage/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,11 @@ func (fs *S3FileStorage) SaveByKey(src io.Reader, key, name, contentType string,
}

input := &s3.PutObjectInput{
Bucket: aws.String(fs.bucket),
Key: aws.String(key),
Body: src,
ContentType: aws.String(contentType),
Metadata: map[string]string{
"Content-Disposition": fmt.Sprintf("attachment; filename*=UTF-8''%s", url.PathEscape(name)),
},
Bucket: aws.String(fs.bucket),
Key: aws.String(key),
Body: src,
ContentType: aws.String(contentType),
ContentDisposition: aws.String(fmt.Sprintf("attachment; filename*=UTF-8''%s", url.PathEscape(name))),
}

uploader := manager.NewUploader(fs.client)
Expand Down

0 comments on commit 55b5922

Please sign in to comment.