motion_surveillance.py 文件源码

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

项目:iot-detroit-jan2017 作者: mvartani76 项目源码 文件源码
def upload_image_to_s3(image_file_path, bucket_name):

    """Uploads images to Amazon's S3 service.

    Arguments:

    image_file_path:    Path to image 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).

    """
    print("Entered s3 upload...")
    print(bucket_name)
    bucket = s3_connection.get_bucket(bucket_name)

    # Create a new key using image_file_path as the key
    key = Key(bucket)
    key.key = image_file_path 
    key.set_contents_from_filename(image_file_path)

    return key

# Send Alert to Phone Number Using Twilio
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号