def upload_file_to_s3(file_file_path, bucket_name):
"""Uploads files to Amazon's S3 service.
Arguments:
file_file_path: Path to file to upload on local machine.
bucket_name: Name of the S3 bucket where file should be uploaded.
key_name: Name of the key for the file on S3 (usually the
timestamp).
"""
bucket = s3_connection.get_bucket(bucket_name)
# Create a new key using file_file_path as the key
key = Key(bucket)
key.key = file_file_path
key.set_contents_from_filename(file_file_path)
return key
aws_s3_file_upload.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录