• Nitric.io
  • Star on GitHub
Back to Home
Node.js
  • Nitric.io
    • Getting Started
  • APIs

    • api()
    • api.get()
    • api.post()
    • api.put()
    • api.delete()
    • api.patch()
    • api.route()
    • api.route.all()
    • api.route.get()
    • api.route.post()
    • api.route.put()
    • api.route.delete()
    • api.route.patch()
  • HTTP

    • http()
  • Key Value Stores

    • kv()
    • kv.get()
    • kv.set()
    • kv.delete()
    • kv.keys()
  • Topics

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

    • queue()
    • queue.enqueue()
    • queue.dequeue()
  • Secrets

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

    • bucket()
    • bucket.on()
    • bucket.file()
      • Parameters
      • Available Operations
    • bucket.files()
    • file.exists()
    • file.read()
    • file.write()
    • file.delete()
    • file.getDownloadUrl()
    • file.getUploadUrl()
  • SQL

    • sql()
    • sql.connectionString()
  • Schedules

    • schedule()
    • schedule.every()
    • schedule.cron()
  • Websockets

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

Node.js - bucket.file()

Create a reference to a file within a bucket.

import { bucket } from '@nitric/sdk'

const assets = bucket('assets').allow('read')

const 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