aws.s3
aws.s3 copied to clipboard
Retrieving a csv file in S3 -
I am able to access my buckets as
library("aws.s3")
bucketlist()
I have a csv file in a bucket nested in folders. When I try to read in the csv:
read.csv(text = rawToChar(get_object(object = "/folder/folder2/filename.csv", bucket="mybucket")))
I received an error (is there a more proper way to access the file)?
X..xml.version.1.0.encoding.UTF.8..
1 <Error><Code>PermanentRedirect</Code><Message>The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.</Message><Bucket>mybucket</Bucket><Endpoint>mybucket.s3.amazonaws.com</Endpoint><RequestId>8DD0D95EA0113249</RequestId><HostId>rsU23k2Q4lTEUqLDL+074wwZdlCVHOPnec6aip5sGUmCHax2ety9don+3SAR8JWWa1rvSFYK+hk=</HostId></Error>
Try adding url_style ="virtual" to your call.
