Index
Properties
bucket
fullPath
name
parent
root
storage
Methods
child
Parameters
path: string
The relative path from this reference. Leading, trailing, and consecutive slashes are removed.
Returns Reference
The reference to the given path.
delete
Returns Promise<void>
A Promise that resolves if the deletion succeeded and rejects if it failed, including if the object didn't exist.
getDownloadURL
Returns Promise<string>
A Promise that resolves with the download URL or rejects if the fetch failed, including if the object did not exist.
getMetadata
Returns Promise<FullMetadata>
A Promise that resolves with the metadata, or rejects if the fetch failed, including if the object did not exist.
list
List API is only available for Firebase Rules Version 2.
GCS is a key-blob store. Firebase Storage imposes the semantic of '/' delimited folder structure. Refer to GCS's List API if you want to learn more.
To adhere to Firebase Rules's Semantics, Firebase Storage does not support objects whose paths end with "/" or contain two consecutive "/"s. Firebase Storage List API will filter these unsupported objects.
list()
may fail if there are too many unsupported objects in the bucket.Parameters
Optional options: ListOptions
See
ListOptions
for details.
Returns Promise<ListResult>
A Promise that resolves with the items and prefixes.
prefixes
contains references to sub-folders anditems
contains references to objects in this folder.nextPageToken
can be used to get the rest of the results.
listAll
This is a helper method for calling
list()
repeatedly until there are no more results. The default pagination size is 1000.Note: The results may not be consistent if objects are changed while this operation is running.
Warning:
listAll
may potentially consume too many resources if there are too many results.Returns Promise<ListResult>
A Promise that resolves with all the items and prefixes under the current storage reference.
prefixes
contains references to sub-directories anditems
contains references to objects in this folder.nextPageToken
is never returned.
put
Parameters
data: Blob | Uint8Array | ArrayBuffer
The data to upload.
Optional metadata: UploadMetadata
Metadata for the newly uploaded object.
Returns firebase.storage.UploadTask
An object that can be used to monitor and manage the upload.
putString
Parameters
data: string
The string to upload.
Optional format: StringFormat
The format of the string to upload.
Optional metadata: UploadMetadata
Metadata for the newly uploaded object.
Returns firebase.storage.UploadTask
toString
Returns string
The gs:// URL.
updateMetadata
Parameters
metadata: SettableMetadata
The new metadata. Setting a property to 'null' removes it on the server, while leaving a property as 'undefined' has no effect.
Returns Promise<FullMetadata>
A Promise that resolves with the full updated metadata or rejects if the updated failed, including if the object did not exist.