The Firebase Storage service interface.
Do not call this constructor directly. Instead, usefirebase.storage().
See Get Started on Webfor a full guide on how to use the Firebase Storage service.
Index
Properties
app
Theapp associated with theStorage serviceinstance.
- example
var app = storage.app;
maxOperationRetryTime
The maximum time to retry operations other than uploads or downloads inmilliseconds.
maxUploadRetryTime
The maximum time to retry uploads in milliseconds.
Methods
ref
- ref(path?: string):Reference
Returns a reference for the given path in the default bucket.
Parameters
Optional path:string
A relative path to initialize the reference with,for example
path/to/image.jpg. If not passed, the returned referencepoints to the bucket root.
ReturnsReference
A reference for the given path.
refFromURL
setMaxOperationRetryTime
- set
Max Operation Retry Time(time: number):any Parameters
time:number
The new maximum operation retry time in milliseconds.
Returnsany
setMaxUploadRetryTime
- set
Max Upload Retry Time(time: number):any Parameters
time:number
The new maximum upload retry time in milliseconds.
Returnsany
useEmulator
- use
Emulator(host: string, port: number, options?: {mockUserToken?:EmulatorMockTokenOptions |string }):void Modify this
Storageinstance to communicate with the Cloud Storage emulator.Parameters
host:string
The emulator host (ex: localhost)
port:number
The emulator port (ex: 5001)
Optional options:{mockUserToken?:EmulatorMockTokenOptions |string }
Optional mock
User Token?:EmulatorMockTokenOptions |string the mock auth token to use for unit testing Security Rules
Returnsvoid
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 2022-07-27 UTC.