getFile: Retrieve the contents of an object stored on the S3 server

Description Usage Arguments Value Author(s) References See Also

Description

getFile function returns the contents of the specified object that is stored on the S3 object. It returns the contents that were uploaded and specifies the content type for the file's contents.

s3Exists tests whether the specified bucket/object exists and can be read.

Usage

1
2
getFile(bucket, name, auth = getOption("AmazonS3"), curl = getCurlHandle(),
           binary = NA, virtual = (tolower(bucket) == bucket), verbose = FALSE)

Arguments

bucket

the name of the AWS bucket. One can also specify the bucket and object/file name as "bucket/name".

name

the name of the object within the bucket to remove

auth

a named character vector giving the AWS key and secret as a c(key = secret).

curl

a curl handle that the caller can specif to reuse an existing object that is resused across different libcurl calls.

virtual

a logical value indicating whether to use the virtual host mechanism or s3.amazonaws.com/bucket/obj format. The default argument is most likely the appropriate value.

binary

a logical value (TRUE, FALSE or NA) indicating whether the content of the file is known to be binary or not, or unknown. The retrieval mechanism attempts to understand the Content-Type to determine this, erring on the side of treating the content as binary. See rawToChar to convert the resulting raw vector to a character string.

verbose

a logical value allowing the caller to see details of the HTTP request and response.

Value

getFile returns the contents of the object. The Content-Type will be available on the result as an attribute. If the content type is binary, the result is a raw vector. Otherwise, the result is a character vector of length 1.

s3Exists returns TRUE or FALSE if the object can is on the S3 server. If permission to check the object is not available, the result is NA.

Author(s)

Duncan Temple Lang <duncan@wald.ucdavis.edu>

References

http://docs.amazonwebservices.com/AmazonS3/latest/gsg/

See Also

listBucket removeFile about setS3Access


duncantl/RAmazonS3 documentation built on May 15, 2019, 5:26 p.m.