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
Returns theFirebaseStorage , initialized with the defaultFirebase.FirebaseApp
LogLevel
Sets or Gets how verbose CloudStorage Logging will be.
MaxDownloadRetryTime
TimeSpan
Returns the maximum time to retry a download if a failure occurs.
MaxOperationRetryTime
TimeSpan
Sets the maximum time to retry operations other than upload and download if a failure occurs.
MaxUploadRetryTime
TimeSpan
Returns 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)
Creates aStorageReference given a gs:// orhttps:// URL pointing to aFirebaseStorage location.
Url()
string
Returns a gs:// url to the CloudStorage Bucket, or an empty string if thisStorage was created with default parameters.
UseEmulator(string host, int port)
void
Configures 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

App

FirebaseAppApp

TheFirebase.FirebaseApp associated with thisFirebaseStorage instance.

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 toLogLevel.Verbose

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
location
A relative path from the root to initialize the reference with, for instance "path/to/object"
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
fullUrl
A gs:// or http[s]:// URL used to initialize the reference. For example, you can pass in a download URL retrieved fromStorageReference.GetDownloadUrlAsync or the uri retrieved fromStorageReference.ToString() An error is thrown if fullUrl is not associated with theFirebase.FirebaseApp used to initialize thisFirebaseStorage

Url

stringUrl()

Returns a gs:// url to the CloudStorage Bucket, or an empty string if thisStorage was created with default parameters.

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
host
The host that the storage emulator is running on.
port
The port that the storage emulator is running on.

Public static functions

GetInstance

FirebaseStorageGetInstance(FirebaseAppapp,stringurl)

Returns theFirebaseStorage , initialized with a customFirebase.FirebaseApp

Details
Parameters
app
The customFirebase.FirebaseApp used for initialization.
url
The gs:// url to your CloudStorage Bucket.
Returns
aFirebaseStorage instance.

GetInstance

FirebaseStorageGetInstance(stringurl)

Returns theFirebaseStorage , initialized with the defaultFirebase.FirebaseApp and a customStorage Bucket

Details
Parameters
url
The gs:// url to your CloudStorage Bucket.
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.