firebase. storage
storage
storage(app) returns firebase.storage.Storage
Gets the Storage service for the default app or a given app.
firebase.storage() can be called with no arguments to access the default app's Storage service or as
firebase.storage(app) to access the
Storage service associated with a specific app.
Parameter |
|
|---|---|
|
app |
Optional The app to create a storage service for. If not passed, uses the default app. Value must not be null. |
- Returns
-
non-null firebase.storage.Storage
Examples
// Get the Storage service for the default app
var defaultStorage = firebase.storage();
// Get the Storage service for a given app
var otherStorage = firebase.storage(otherApp);
Interfaces
FullMetadata
Reference
SettableMetadata
Storage
UploadMetadata
UploadTask
UploadTaskSnapshot
Enumerations
StringFormat
string
An enumeration of the possible string formats for upload.
Properties
Parameter |
|
|---|---|
|
RAW |
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 byte sequence. Example: The string 'Hello! \ud83d\ude0a' becomes the byte sequence 48 65 6c 6c 6f 21 20 f0 9f 98 8a |
|
BASE64 |
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 sequence ad 69 8e fb e1 3a b7 bf eb 97 |
|
BASE64URL |
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 sequence ad 69 8e fb e1 3a b7 bf eb 97 |
|
DATA_URL |
Indicates the string is a data URL, such as one obtained from canvas.toDataURL(). Example: the string 'data:application/octet-stream;base64,aaaa' becomes the byte sequence 69 a6 9a (the content-type "application/octet-stream" is also applied, but can be overridden in the metadata object). |
TaskEvent
string
An event that is triggered on a task.
Property
Parameter |
|
|---|---|
|
STATE_CHANGED |
For this event,
|
- See also
- firebase.storage.UploadTask.prototype.on
TaskState
string
Represents the current state of a running upload.
Properties
Parameter |
|
|---|---|
|
RUNNING |
Indicates that the task is still running and making progress. |
|
PAUSED |
Indicates that the task is paused. |
|
SUCCESS |
Indicates that the task completed successfully. |
|
CANCELED |
Indicates that the task was canceled. |
|
ERROR |
Indicates that the task failed for a reason other than being canceled. |
Properties
StringFormat
string
An enumeration of the possible string formats for upload.
Properties
Parameter |
|
|---|---|
|
RAW |
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 byte sequence. Example: The string 'Hello! \ud83d\ude0a' becomes the byte sequence 48 65 6c 6c 6f 21 20 f0 9f 98 8a |
|
BASE64 |
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 sequence ad 69 8e fb e1 3a b7 bf eb 97 |
|
BASE64URL |
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 sequence ad 69 8e fb e1 3a b7 bf eb 97 |
|
DATA_URL |
Indicates the string is a data URL, such as one obtained from canvas.toDataURL(). Example: the string 'data:application/octet-stream;base64,aaaa' becomes the byte sequence 69 a6 9a (the content-type "application/octet-stream" is also applied, but can be overridden in the metadata object). |
TaskEvent
string
An event that is triggered on a task.
Property
Parameter |
|
|---|---|
|
STATE_CHANGED |
For this event,
|
- See also
- firebase.storage.UploadTask.prototype.on
TaskState
string
Represents the current state of a running upload.
Properties
Parameter |
|
|---|---|
|
RUNNING |
Indicates that the task is still running and making progress. |
|
PAUSED |
Indicates that the task is paused. |
|
SUCCESS |
Indicates that the task completed successfully. |
|
CANCELED |
Indicates that the task was canceled. |
|
ERROR |
Indicates that the task failed for a reason other than being canceled. |

