Python - bucket.file.read()
Read a file from a bucket.
from nitric.resources import bucketfrom nitric.application import Nitric# Create a reference to an 'assets' bucket with permissions to readassets = bucket('assets').allow('reading')logo = assets.file('images/logo.png')logo_data = await logo.read()Nitric.run()
Examples
Read a file
from nitric.resources import bucketfrom nitric.application import Nitricassets = bucket('assets').allow('reading')logo = assets.file('images/logo.png')logo_data = await logo.read()Nitric.run()
Last updated on Dec 30, 2024