You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this is my code below:
// Create an Amazon S3 service client
client := s3.New(s3.Options{
Region: "ap-east-1",
})
var partMiBs int64 = 10
downloader := manager.NewDownloader(client, func(d *manager.Downloader) {
d.PartSize = partMiBs * 1024 * 1024
})
resp, err := client.ListObjectsV2(context.TODO(), &s3.ListObjectsV2Input{Bucket: aws.String(BASE_BUCKET)})
if err != nil {
fmt.Println("Failed to list objects", err)
return err
}
for _, item := range resp.Contents {
file, err := os.Create(strings.Replace(*item.Key, "/", "_", -1))
if err != nil {
fmt.Println("Failed to create file", err)
return err
}
defer file.Close()
_, err = downloader.Download(context.TODO(), file,
&s3.GetObjectInput{
Bucket: aws.String(BASE_BUCKET),
Key: item.Key,
})
if err != nil {
fmt.Println("Failed to download file", err)
return err
}
fmt.Println("Successfully downloaded file to", file.Name())
}
when downloader.Download, throw a error:
Failed to download file operation error S3: GetObject, https response error StatusCode: 400, RequestID: KMDB2AVM0JCH022F, HostID: G6krUUQmmlYlLuudmhRc4/FVbtFwju8F+UWg9xBVFRtZkPKrf1EJGpg1UwxCLzPLkIkOKQzLiYh4d7gFF1sSmA==, api error InvalidArgument: Requests specifying Server Side Encryption with AWS KMS managed keys require AWS Signature Version 4.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
this is my code below:
// Create an Amazon S3 service client
client := s3.New(s3.Options{
Region: "ap-east-1",
})
var partMiBs int64 = 10
downloader := manager.NewDownloader(client, func(d *manager.Downloader) {
d.PartSize = partMiBs * 1024 * 1024
})
resp, err := client.ListObjectsV2(context.TODO(), &s3.ListObjectsV2Input{Bucket: aws.String(BASE_BUCKET)})
if err != nil {
fmt.Println("Failed to list objects", err)
return err
}
when downloader.Download, throw a error:
Failed to download file operation error S3: GetObject, https response error StatusCode: 400, RequestID: KMDB2AVM0JCH022F, HostID: G6krUUQmmlYlLuudmhRc4/FVbtFwju8F+UWg9xBVFRtZkPKrf1EJGpg1UwxCLzPLkIkOKQzLiYh4d7gFF1sSmA==, api error InvalidArgument: Requests specifying Server Side Encryption with AWS KMS managed keys require AWS Signature Version 4.
Beta Was this translation helpful? Give feedback.
All reactions