app-engine-function/main.py
def upload_blob(bucket_name, src_file, dst_file_name):
    """Upload a file to the bucket"""
    storage_client = storage.Client()
    bucket = storage_client.get_bucket(bucket_name)
    blob = bucket.blob('uploads/'+dst_file_name)

    blob.upload_from_string(src_file, content_type='image/jpg')

    print('File uploaded to uploads/{}.'.format(dst_file_name))
Upload a file to the bucket
Upload a file to the bucket
Upload a file to the bucket
def upload_blob(bucket_name, src_file, dst_file_name):
    storage_client = storage.Client()
    bucket = storage_client.get_bucket(bucket_name)
    blob = bucket.blob('uploads/'+dst_file_name)
    blob.upload_from_string(src_file, content_type='image/jpg')
    print('File uploaded to uploads/{}.'.format(dst_file_name))
def upload_blob ( bucket_name , src_file , dst_file_name ) : storage_client = storage . Client ( ) bucket = storage_client . get_bucket ( bucket_name ) blob = bucket . blob ( 'uploads/' + dst_file_name ) blob . upload_from_string ( src_file , content_type = 'image/jpg' ) print ( 'File uploaded to uploads/{}.' . format ( dst_file_name ) )
Upload a file to the bucket
Upload a file to the bucket
"""Upload a file to the bucket"""
bucket_name
src_file
dst_file_name