Created
July 24, 2017 20:55
-
-
Save lizturp/44ae1f0cd1e1d381f6310664df2bf611 to your computer and use it in GitHub Desktop.
Basic script to test upload to s3 functionality is working in R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/Rscript | |
library(aws.s3) | |
library(stringi) | |
source("./credentials/aws.txt") | |
#bucketlist() | |
s3conn <- rawConnection(raw(0), "r+") | |
#this is not writing anything out.... | |
tempfile <- paste0("hello this is a test.") | |
put_object(tempfile, | |
object = ("liz-example/redshift/tempfile"), | |
bucket="my-bucket-name", | |
file=rawConnectionValue(s3conn), | |
headers = c('x-amz-server-side-encryption'='AES256')) | |
#but the file is there! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment