question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ANDROID Google drive file uri upload to firebase

See original GitHub issue

Hi 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Eramirez06commented, Nov 5, 2019

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

1reaction
dantmancommented, Oct 15, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upload files with Cloud Storage on Android - Firebase
Upload from a local file. You can upload local files on the device, such as photos and videos from the camera, with the...
Read more >
How to upload files to firebase storage from google drive ...
From the script editor, choose "File" and "Project Properties" and click the "Scopes" tab. Copy out all the existing scopes, and paste them...
Read more >
Android: How to Upload an image on Firebase storage?
Android : How to Upload an image on Firebase storage? · Step 1. Create a new project on android studio or open an...
Read more >
Upload file data | Drive API - Google Developers
Create a POST request to the method's /upload URI with the query parameter of uploadType=media : POST https://www.googleapis.com/upload/drive/v3/files?
Read more >
Access documents and other files from shared storage
The app gains read and write access to a URI that represents the user's chosen location or document. Using this URI, the app...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found