aws_s3_file_upload.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:iot-detroit-jan2017 作者: mvartani76 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号