Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR]: Add FileHandle support to FirebaseStorage #12579

Closed
mattcomi opened this issue Mar 19, 2024 · 2 comments
Closed

[FR]: Add FileHandle support to FirebaseStorage #12579

mattcomi opened this issue Mar 19, 2024 · 2 comments

Comments

@mattcomi
Copy link
Contributor

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

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@paulb777
Copy link
Member

Extension support was added without adding the FileHandle APIs. See the discussion in #12580

@firebase firebase locked and limited conversation to collaborators Apr 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants