Skip to content

[FR]: Add FileHandle support to FirebaseStorage #12579

Closed
@mattcomi

Description

@mattcomi

Description

Use Case

Upload a large (+100MB) file from a share extension.

How the Firebase SDK currently handles it

The Firebase SDK doesn't currently support uploading a large (+100MB) file from an app extension. StorageReference has putData and putFile on its public interface. putData won't work because an app extension has a 120MB memory limit and putFile doesn't work in app extensions.

How you propose the Firebase SDK should handle it

Under the hood, FirebaseStorage uses GTMSessionUploadFetcher to perform uploads. The GTMSessionUploadFetcher supports uploading from a number of data sources: data, file, file handle and data provider. I propose exposing the file handle capability to StorageReference (through StorageUploadTask).

API Proposal

func putFileHandle(_ fileHandle: FileHandle, metadata: StorageMetadata? = nil) -> StorageUploadTask

func putFileHandleAsync(_ fileHandle: FileHandle,
                          metadata: StorageMetadata? = nil,
                          onProgress: ((Progress?) -> Void)? = nil) async throws -> StorageMetadata

Firebase Product(s)

Firestore

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions