StorageReference

actual class StorageReference(source)
expect class StorageReference(source)

Represents a reference to a Google Cloud Storage object. Developers can upload and download objects, get/set object metadata, and delete an object at a specified path.

actual class StorageReference(source)
actual class StorageReference(source)
actual class StorageReference(source)

Constructors

Link copied to clipboard
constructor(android: StorageReference)
constructor(ios: FIRStorageReference)
constructor(js: StorageReference)
constructor()

Properties

Link copied to clipboard
val StorageReference.android: StorageReference
Link copied to clipboard
actual val bucket: String
expect val bucket: String

Return the Google Cloud Storage bucket that holds this object.

actual val bucket: String
actual val bucket: String
actual val bucket: String
Link copied to clipboard
val StorageReference.ios: FIRStorageReference
Link copied to clipboard
val StorageReference.js: StorageReference
Link copied to clipboard
actual val name: String
expect val name: String

Returns the short name of this object.

actual val name: String
actual val name: String
actual val name: String
Link copied to clipboard

Returns a new instance of StorageReference pointing to the parent location or null if this instance references the root location. For example:

Link copied to clipboard
actual val path: String
expect val path: String

Returns the full path to this object, not including the Google Cloud Storage bucket.

actual val path: String
actual val path: String
actual val path: String
Link copied to clipboard

Returns a new instance of {@link StorageReference} pointing to the root location.

Link copied to clipboard

Returns the FirebaseStorage service which created this reference.

Functions

Link copied to clipboard
actual fun child(path: String): StorageReference
expect fun child(path: String): StorageReference

Returns a new instance of StorageReference pointing to a child location of the current reference. All leading and trailing slashes will be removed, and consecutive slashes will be compressed to single slashes. For example:

actual fun child(path: String): StorageReference
actual fun child(path: String): StorageReference
actual fun child(path: String): StorageReference
Link copied to clipboard
actual suspend fun delete()
expect suspend fun delete()

Deletes the object at this {@link StorageReference}.

actual suspend fun delete()
actual suspend fun delete()
actual suspend fun delete()
Link copied to clipboard
actual suspend fun getDownloadUrl(): String
expect suspend fun getDownloadUrl(): String

Asynchronously retrieves a long lived download URL with a revokable token. This can be used to share the file with others, but can be revoked by a developer in the Firebase Console if desired.

actual suspend fun getDownloadUrl(): String
actual suspend fun getDownloadUrl(): String
actual suspend fun getDownloadUrl(): String
Link copied to clipboard
actual suspend fun getMetadata(): FirebaseStorageMetadata?
expect suspend fun getMetadata(): FirebaseStorageMetadata?

Retrieves metadata associated with an object at this StorageReference.

actual suspend fun getMetadata(): FirebaseStorageMetadata?
actual suspend fun getMetadata(): FirebaseStorageMetadata?
actual suspend fun getMetadata(): FirebaseStorageMetadata?
Link copied to clipboard
actual suspend fun listAll(): ListResult
expect suspend fun listAll(): ListResult

List all items (files) and prefixes (folders) under this StorageReference.

actual suspend fun listAll(): ListResult
actual suspend fun listAll(): ListResult
actual suspend fun listAll(): ListResult
Link copied to clipboard
actual suspend fun putData(data: Data, metadata: FirebaseStorageMetadata?)
expect suspend fun putData(data: Data, metadata: FirebaseStorageMetadata? = null)

Asynchronously uploads byte data to this StorageReference. This is not recommended for large files. Instead upload a file via putFile.

actual suspend fun putData(data: Data, metadata: FirebaseStorageMetadata?)
actual suspend fun putData(data: Data, metadata: FirebaseStorageMetadata?)
actual suspend fun putData(data: Data, metadata: FirebaseStorageMetadata?)
Link copied to clipboard
actual suspend fun putFile(file: File, metadata: FirebaseStorageMetadata?)
expect suspend fun putFile(file: File, metadata: FirebaseStorageMetadata? = null)

Asynchronously uploads from a content URI to this StorageReference.

actual suspend fun putFile(file: File, metadata: FirebaseStorageMetadata?)
actual suspend fun putFile(file: File, metadata: FirebaseStorageMetadata?)
Link copied to clipboard
expect fun putFileResumable(file: File, metadata: FirebaseStorageMetadata? = null): ProgressFlow

Asynchronously uploads from a content URI to this StorageReference.