mirror of
https://github.com/usememos/memos.git
synced 2024-11-23 22:07:47 +03:00
chore: tweak s3 comments
This commit is contained in:
parent
e016244aba
commit
436eb0e591
@ -64,17 +64,17 @@ func NewClient(ctx context.Context, config *Config) (*Client, error) {
|
||||
|
||||
func (client *Client) UploadFile(ctx context.Context, filename string, fileType string, src io.Reader) (string, error) {
|
||||
uploader := manager.NewUploader(client.Client)
|
||||
// set ACL according to if user set prefix
|
||||
obj := awss3.PutObjectInput{
|
||||
putInput := awss3.PutObjectInput{
|
||||
Bucket: aws.String(client.Config.Bucket),
|
||||
Key: aws.String(filename),
|
||||
Body: src,
|
||||
ContentType: aws.String(fileType),
|
||||
}
|
||||
// Set ACL according to if url prefix is set.
|
||||
if client.Config.URLPrefix == "" {
|
||||
obj.ACL = types.ObjectCannedACL(*aws.String("public-read"))
|
||||
putInput.ACL = types.ObjectCannedACL(*aws.String("public-read"))
|
||||
}
|
||||
uploadOutput, err := uploader.Upload(ctx, &obj)
|
||||
uploadOutput, err := uploader.Upload(ctx, &putInput)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user