I've been trying to upload an object to S3 with public access but I haven't been able to do it.
I am getting this error: InvalidArgument: Argument format not recognized status code: 400
Here is my code:
bucketName := "test-bucket"
key2 := "test.zip"
upParams := &s3manager.UploadInput{
Bucket: &bucketName,
Key: &key2,
Body: response.Body,
GrantRead: aws.String("uri:http://acs.amazonaws.com/groups/global/AllUsers"),
}
sess := session.Must(session.NewSession())
uploader := s3manager.NewUploader(sess)
_, err = uploader.Upload(upParams)
Try ACL : "public-read" instead
bucketName := "test-bucket"
key2 := "test.zip"
upParams := &s3manager.UploadInput{
Bucket: &bucketName,
Key: &key2,
Body: response.Body,
ACL: "public-read",
}
sess := session.Must(session.NewSession())
uploader := s3manager.NewUploader(sess)
_, err = uploader.Upload(upParams)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With