The Firebase Storage service interface.

Do not call this constructor directly. Instead, usefirebase.storage().

See Get Started on Webfor a full guide on how to use the Firebase Storage service.

Index

Properties

app

app:App

Theapp associated with theStorage serviceinstance.

example
var app = storage.app;

maxOperationRetryTime

maxOperationRetryTime:number

The maximum time to retry operations other than uploads or downloads inmilliseconds.

maxUploadRetryTime

maxUploadRetryTime:number

The maximum time to retry uploads in milliseconds.

Methods

ref

  • ref(path?: string):Reference
  • Returns a reference for the given path in the default bucket.

    Parameters

    • Optional path:string

      A relative path to initialize the reference with,for examplepath/to/image.jpg. If not passed, the returned referencepoints to the bucket root.

    ReturnsReference

    A reference for the given path.

refFromURL

  • refFromURL(urlstring):Reference
  • Returns a reference for the given absolute URL.

    Parameters

    • url:string

      A URL in the form:
      1) a gs:// URL, for examplegs://bucket/files/image.png
      2) a download URL taken from object metadata.

    ReturnsReference

    A reference for the given URL.

setMaxOperationRetryTime

setMaxUploadRetryTime

useEmulator

  • useEmulator(hoststring, portnumber, options?: {mockUserToken?:EmulatorMockTokenOptions |string }):void
  • Modify thisStorage instance to communicate with the Cloud Storage emulator.

    Parameters

    • host:string

      The emulator host (ex: localhost)

    • port:number

      The emulator port (ex: 5001)

    • Optional options:{mockUserToken?:EmulatorMockTokenOptions |string }

    Returnsvoid

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2022-07-27 UTC.