Firebase. Storage. FirebaseStorage
FirebaseStorage is a service that supports uploading and downloading large objects to Google CloudStorage.
Summary
FirebaseStorage is a service that supports uploading and downloading large objects to Google CloudStorage. Pass a custom instance ofFirebase.FirebaseApp toGetInstance which will initialize it with a storage location (bucket) specified viaAppOptions.StorageBucket
Otherwise, if you callDefaultInstance without aFirebaseApp, theFirebaseStorage instance will initialize with the defaultFirebase.FirebaseApp obtainable fromFirebaseApp.DefaultInstance. The storage location in this case will come the JSON configuration file downloaded from the web.
Properties | |
|---|---|
App | TheFirebase.FirebaseApp associated with thisFirebaseStorage instance. |
DefaultInstance | staticFirebaseStorageReturns theFirebaseStorage , initialized with the defaultFirebase.FirebaseApp |
LogLevel | Sets or Gets how verbose CloudStorage Logging will be. |
MaxDownloadRetryTime | TimeSpanReturns the maximum time to retry a download if a failure occurs. |
MaxOperationRetryTime | TimeSpanSets the maximum time to retry operations other than upload and download if a failure occurs. |
MaxUploadRetryTime | TimeSpanReturns the maximum time to retry an upload if a failure occurs. |
RootReference | Creates a newStorageReference initialized at the root CloudStorage location. |
Public functions | |
|---|---|
GetReference(string location) | Creates a newStorageReference initialized with a child CloudStorage location. |
GetReferenceFromUrl(string fullUrl) | |
Url() | string |
UseEmulator(string host, int port) | voidConfigures theStorage SDK to use an emulated backend instead of the default remote backend. |
Public static functions | |
|---|---|
GetInstance(FirebaseApp app, string url) | Returns theFirebaseStorage , initialized with a customFirebase.FirebaseApp |
GetInstance(string url) | Returns theFirebaseStorage , initialized with the defaultFirebase.FirebaseApp and a customStorage Bucket |
Properties
DefaultInstance
staticFirebaseStorageDefaultInstance
Returns theFirebaseStorage , initialized with the defaultFirebase.FirebaseApp
aFirebaseStorage instance.
LogLevel
LogLevelLogLevel
Sets or Gets how verbose CloudStorage Logging will be.
To obtain more debug information, set this to
MaxDownloadRetryTime
TimeSpanMaxDownloadRetryTime
Returns the maximum time to retry a download if a failure occurs.
maximum time which defaults to 10 minutes (600,000 milliseconds).
MaxOperationRetryTime
TimeSpanMaxOperationRetryTime
Sets the maximum time to retry operations other than upload and download if a failure occurs.
MaxUploadRetryTime
TimeSpanMaxUploadRetryTime
Returns the maximum time to retry an upload if a failure occurs.
| Details | |
|---|---|
| Returns | the maximum time which defaults to 10 minutes (600,000 milliseconds). |
RootReference
StorageReferenceRootReference
Creates a newStorageReference initialized at the root CloudStorage location.
| Details | |
|---|---|
| Returns | An instance ofStorageReference |
Public functions
GetReference
StorageReferenceGetReference(stringlocation)
Creates a newStorageReference initialized with a child CloudStorage location.
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | An instance ofStorageReference at the given child path. |
GetReferenceFromUrl
StorageReferenceGetReferenceFromUrl(stringfullUrl)
Creates aStorageReference given a gs:// orhttps:// URL pointing to aFirebaseStorage location.
| Details | |||
|---|---|---|---|
| Parameters |
|
Url
stringUrl()
UseEmulator
voidUseEmulator(stringhost,intport)
Configures theStorage SDK to use an emulated backend instead of the default remote backend.
This method should be called before invoking any other methods on a new instance ofStorage
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
|
Public static functions
GetInstance
FirebaseStorageGetInstance(FirebaseAppapp,stringurl)
Returns theFirebaseStorage , initialized with a customFirebase.FirebaseApp
| Details | |||||
|---|---|---|---|---|---|
| Parameters |
| ||||
| Returns | aFirebaseStorage instance. |
GetInstance
FirebaseStorageGetInstance(stringurl)
Returns theFirebaseStorage , initialized with the defaultFirebase.FirebaseApp and a customStorage Bucket
| Details | |||
|---|---|---|---|
| Parameters |
| ||
| Returns | aFirebaseStorage instance. |
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 2025-11-20 UTC.