def upload_image_file(file):
    if not file:
        return None

    public_url = storage.upload_file(
        file.read(),
        file.filename,
        file.content_type
    )

    current_app.logger.info(
        "Uploaded file %s as %s.", file.filename, public_url)

    return public_url
Upload the user-uploaded file to Google Cloud Storage and retrieve its
dataset/ETHPy150Open GoogleCloudPlatform/getting-started-python/6-pubsub/bookshelf/crud.py/upload_image_file