Python - bucket.file.upload_url()
Create a signed url for write access to a file.
from nitric.resources import bucketfrom nitric.application import Nitricassets = bucket('assets').allow('write')logo = assets.file('images/logo.png')upload_url = await logo.upload_url()Nitric.run()
Earlier versions of the Nitric SDK used 'writing'. The latest version uses 'write'.
Parameters
- Name
expiry
- Optional
- Optional
- Type
- number
- Description
Seconds until link expiry. Maximum of 604800 (7 days).
Examples
Create a temporary file upload link for a user
from nitric.resources import bucketfrom nitric.application import Nitricuploads = bucket('uploads').allow('write')photo = assets.file('images/photo.png')photo_url = await logo.upload_url()Nitric.run()
Last updated on Nov 4, 2024