def upload_file(self, filename_to_save_as, file_path):
"""
:description: uploads a single file to an s3 bucket
"""
# what is this?
def percent_cb(complete, total):
sys.stdout.write('.')
sys.stdout.flush()
# select the bucket, where input_s3_bucket takes the form 'bsdsdata'
bucket = self.conn.get_bucket(self.s3_bucket)
# send the file to the s3 bucket
key = Key(bucket)
key.key = filename_to_save_as
key.set_contents_from_filename(file_path, cb=percent_cb, num_cb=50)
评论列表
文章目录