mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
feat(s3): customize filenames via placeholders (#1285)
* feat(s3): customize filenames via placeholders * fix go-static-checks * add tips on the frontend * fix eslint check * remove yarn.lock * remove Config.Path * update tips * fix * update
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io"
|
||||
"path"
|
||||
|
||||
"github.com/aws/aws-sdk-go-v2/aws"
|
||||
s3config "github.com/aws/aws-sdk-go-v2/config"
|
||||
@@ -19,7 +18,6 @@ type Config struct {
|
||||
SecretKey string
|
||||
Bucket string
|
||||
EndPoint string
|
||||
Path string
|
||||
Region string
|
||||
URLPrefix string
|
||||
}
|
||||
@@ -57,7 +55,7 @@ func (client *Client) UploadFile(ctx context.Context, filename string, fileType
|
||||
uploader := manager.NewUploader(client.Client)
|
||||
uploadOutput, err := uploader.Upload(ctx, &awss3.PutObjectInput{
|
||||
Bucket: aws.String(client.Config.Bucket),
|
||||
Key: aws.String(path.Join(client.Config.Path, filename)),
|
||||
Key: aws.String(filename),
|
||||
Body: src,
|
||||
ContentType: aws.String(fileType),
|
||||
ACL: types.ObjectCannedACL(*aws.String("public-read")),
|
||||
|
Reference in New Issue
Block a user