INNER CODE UNIT · Python
download
miztiik/AWS-Demos · how-to-examples/pdf-to-png-using-boto3-aws.py:59
def download(bucket, key, local_file):
b = boto.connect_s3(KEY, SECRET).get_bucket(bucket)
k = b.get_key(key)
k.get_contents_to_filename(local_file)
def upload_file(local_file, bucket, key, public=False):
b = boto.connect_s3(KEY, SECRET).get_bucket(bucket)
k = b.new_key(key)
k.set_contents_from_filename(local_file)
if public:
k.set_acl('public-read')
def get_tstamp():
return datetime.utcnow().isoformat(' ').split('.')[0]
while True:
request_data = read_json_pointer_message()