Callable

  • storage(app?: App):Storage
  • Gets theStorage service for the defaultapp or a given app.

    firebase.storage() can be called with no arguments to access the defaultapp'sStorage service or asfirebase.storage(app) to access theStorage service associated with aspecific app.

    example
    // Get the Storage service for the default appvar defaultStorage = firebase.storage();
    example
    // Get the Storage service for a given appvar otherStorage = firebase.storage(otherApp);

    Parameters

    • Optional app:App

      The app to create a storage service for.If not passed, uses the default app.

    ReturnsStorage

Index

Type aliases

StringFormat

StringFormat:string

TaskEvent

TaskEvent:string

An event that is triggered on a task.

see

firebase.storage.UploadTask.on

TaskState

TaskState:string

Represents the current state of a running upload.

Variables

StringFormat

StringFormat:{BASE64:StringFormat;BASE64URL:StringFormat;DATA_URL:StringFormat;RAW:StringFormat }

Type declaration

  • BASE64:StringFormat

    Indicates the string should be interpreted as base64-encoded data.Padding characters (trailing '='s) are optional.Example: The string 'rWmO++E6t7/rlw==' becomes the byte sequencead 69 8e fb e1 3a b7 bf eb 97

  • BASE64URL:StringFormat

    Indicates the string should be interpreted as base64url-encoded data.Padding characters (trailing '='s) are optional.Example: The string 'rWmO--E6t7_rlw==' becomes the byte sequencead 69 8e fb e1 3a b7 bf eb 97

  • DATA_URL:StringFormat

    Indicates the string is a data URL, such as one obtained fromcanvas.toDataURL().Example: the string 'data:application/octet-stream;base64,aaaa'becomes the byte sequence69 a6 9a(the content-type "application/octet-stream" is also applied, but canbe overridden in the metadata object).

  • RAW:StringFormat

    Indicates the string should be interpreted "raw", that is, as normal text.The string will be interpreted as UTF-16, then uploaded as a UTF-8 bytesequence.Example: The string 'Hello! \ud83d\ude0a' becomes the byte sequence48 65 6c 6c 6f 21 20 f0 9f 98 8a

TaskEvent

TaskEvent:{STATE_CHANGED:TaskEvent }

Type declaration

  • STATE_CHANGED:TaskEvent

    For this event,

    • The `next` function is triggered on progress updates and when thetask is paused/resumed with afirebase.storage.UploadTaskSnapshot as the firstargument.
    • The `error` function is triggered if the upload is canceled or failsfor another reason.
    • The `complete` function is triggered if the upload completessuccessfully.

TaskState

TaskState:{CANCELED:TaskState;ERROR:TaskState;PAUSED:TaskState;RUNNING:TaskState;SUCCESS:TaskState }

Type declaration

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 2023-09-28 UTC.