Python - bucket.file.write()
Write a file to a bucket.
from nitric.resources import bucketfrom nitric.application import Nitricassets = bucket('assets').allow('reading')logo = assets.file('images/logo.png')logo_data = await logo.write(some_data)Nitric.run()
Parameters
- Name
data
- Required
- Required
- Type
- bytes
- Description
The data to write to the file.
Examples
Write a file
from nitric.resources import bucketfrom nitric.application import Nitric# Create a reference to an 'assets' bucket with write permissionsassets = bucket('assets').allow('writing')logo = assets.file('images/logo.png')logo_data = await logo.write(some_data)Nitric.run()
Last updated on Dec 30, 2024