ANDROID Google drive file uri upload to firebase
See original GitHub issueHi everyone. I like your library thanks for that but on Android I have a problem for uploading the document picker res.uri to firebase storage.
Document picker return to me this kind of URI and I don’t know how to access the path to upload the file to Firebase storage.
content://com.google.android.apps.docs.storage/document/acc%3D1%3Bdoc%3Dencoded%3DyKmSCMqeCKVTPyqzPBQwP9s3jDoaWmxNZFg0XpXjHOqhWlxe8%2F1LMqI6
Firebase won’t accept this kind of URI it return to me an unknown error.
If I pick a document from the internal phone It works as excepted.
Everything work as expected on IOS and also for Google Drive content.
How to get a correct uri to send it to firebase ?
I saw some post issue on your github but honestly I am french and don’t understand all the stuff.
If someone can help me 😃
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top GitHub Comments
I’m having the same issue i cannot upload to firebase exclusive in Android when i select docs from dowload folder and from Google Drive if i pick docs from my internal storage directly all works fine
Document providers work with URIs, not file paths so you cannot get the file path.
If you want to upload it should be possible to use
fetch(
content://…).then(res => res.blob())
to get a Blob instance with the contents of the file. Blobs can be used as post content in XHR/fetch and in FormData to do multipart form uploads.