Python - bucket.file.delete()
Deletes a file within a bucket.
from nitric.resources import bucketfrom nitric.application import Nitric# Create a reference to an 'assets' bucket with permissions to deleteassets = bucket('assets').allow('delete')logo = assets.file('images/logo.png')await logo.delete()Nitric.run()
Earlier versions of the Nitric SDK used 'deleting'. The latest version uses 'delete'.
Examples
Delete a file
from nitric.resources import bucketfrom nitric.application import Nitricassets = bucket('assets').allow('delete')logo = assets.file('images/logo.png')await logo.delete()Nitric.run()
Last updated on Nov 11, 2024