• Nitric.io
Back to HomePython
  • Nitric.io
    • Getting Started
  • APIs

    • api()
    • api.get()
    • api.post()
    • api.put()
    • api.delete()
    • api.patch()
    • api.methods()
    • api.all()
  • Collections

    • collection()
    • collection.collection()
    • collection.query()
    • collection.query.where()
    • collection.query.limit()
    • collection.query.page_from()
    • collection.query.fetch()
    • collection.query.stream()
    • collection.doc()
    • collection.doc.get()
    • collection.doc.set()
    • collection.doc.delete()
    • collection.doc.collection()
  • Topics

    • topic()
    • topic.publish()
    • topic.subscribe()
  • Queues

    • queue()
    • queue.send()
    • queue.receive()
  • Secrets

    • secret()
    • secret.put()
    • secret.version()
    • secret.latest()
    • secret.version.access()
  • Storage

    • bucket()
    • bucket.on()
    • bucket.file()
      • Parameters
      • Notes
      • Available Operations
    • bucket.files()
    • file.read()
    • file.write()
    • file.delete()
    • file.download_url()
    • file.upload_url()
  • Schedules

    • schedule()
  • Websockets

    • websocket()
    • websocket.on()
    • websocket.send()

Python - bucket.file()

Create a reference to a file within a bucket.

from nitric.resources import bucket

assets = bucket('assets').allow('reading')

logo = assets.file('images/logo.png')

Parameters

  • Name
    name
    Required
    Required
    Type
    string
    Description

    The unique name/reference to the file.

Notes

The file does not need to exist, only a reference to that file is being created.

Available Operations

  • file.read()
  • file.write()
  • file.delete()
  • file.getDownloadUrl()
  • file.getUploadUrl()
Edit this page on GitHub
Previousbucket.on()
Nextbucket.files()

What did you think of this content?

© 2024 Nitric Inc.

—ContributionsSupport
Follow us on TwitterFollow us on GitHubJoin our Discord serverYouTube