react-native-image-picker: Video URI on Android incorrect [🐛]
Description
When picking a video file from an Android device, the URI returned doesn’t work, when I visit the returned URI in Chrome, it says file does not exist. Works fine on iOS
Sample response from the launchImageLibrary:
{"fileName": "90510942_824331778088534_328930688839450624_n.mp4", "fileSize": 320924, "uri": "content://com.google.android.apps.photos.contentprovider/-1/2/content%3A%2F%2Fmedia%2Fexternal%2Fvideo%2Fmedia%2F48/ORIGINAL/NONE/2051731147"}
How to repeat issue and example
- step to reproduce the issue
- …
Solution
What needs to be done to address this issue?
Additional Information
- Image Picker version: ^3.1.1
- React Native version: ^0.61.5
- Platform: Android
- Development Operating System: macOS
- Dev tools: Android Studio
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 18
- Comments: 29 (2 by maintainers)
Any solution for this ?
I applied a temporary solution;
yarn add react-native-fsAny solution on how to upload the video using the content uri?
this is a very serious problem and a solution is needed.
I don’t think Content URI is enough to upload to our backend. When trying to upload the file to firebase storage, I get a
Permission Denialerror when using the Content URI.Permission Denial: reading com.google.android.apps.photos.contentprovider.impl.MediaContentProvider uri content://com.google.android.apps.photos.contentprovider/-1/2/content:/media/external/video/media/36/ORIGINAL/NONE/video/mp4/1860530892 from pid=7391, uid=10154 requires the provider be exported, or grantUriPermission()
@ramos07 solution works for me but with a slightly change:
+1