Error while downloading s3 file : operation error S3: GetObject, https response error StatusCode: 404 #1940
suhasbansude
started this conversation in
General
Replies: 2 comments
-
Above issue if for * special character |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @suhasbansud, Since your code is missing, its impossible for me to know what the issue is. I've created a pdf and named it func main() {
cfg, err := config.LoadDefaultConfig(context.TODO(), config.WithRegion("us-east-1"))
if err != nil {
log.Fatalf("unable to load SDK config, %v", err)
}
client := s3.NewFromConfig(cfg)
downloader := manager.NewDownloader(client)
var blob []byte
buf := manager.NewWriteAtBuffer(blob)
// buffer size before download
fmt.Println("bytes: ", len(buf.Bytes()))
_, err = downloader.Download(context.Background(), buf, &s3.GetObjectInput{
Bucket: aws.String("foo-bucket"),
Key: aws.String("! - _ . * ' ( )_test042022.98765432145698745.pdf"),
})
if err != nil {
panic(err)
}
// buffer size after download
fmt.Println("bytes: ", len(buf.Bytes()))
} Output:
Let me know if this helps, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
! - _ . * ' ( )_test042022.98765432145698745.pdf
I am trying to download above file from s3 bucket. getting 404 error
downloader := manager.NewDownloader(awsS3Client)
numBytes, err := downloader.Download(context.TODO(), newFile, &s3V2.GetObjectInput{
Bucket: aws.String(APP_S3BUCKET_NAME),
Key: aws.String(s3FileKey),
})
Beta Was this translation helpful? Give feedback.
All reactions