lundi 7 décembre 2020

image uri is different in android and web

I need help here.

I am using expo-image-picker. When I select an image, the image URI is different in the android app and in web i.e. when I pick an image in the android app the image URI is like below

file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540anonymous%252FDataStreet-dc8e0d36-942b-4031-8cde-a7c936aeef58/ImagePicker/786d58b2-fa4a-49bd-b606-6c22e478ea49.jpg

But the same code gives the below image URI when I select an image in the web(Browser)

data:image/jpeg;base64,/9j/4QBKRXhpZgAASUkqABAAAAAAAAAAAAAAAAEAMQECAB8AAAAiAAAAAAAAAEFkb2JlIFBob3Rvc2hvcCAyMS4xIChXaW5kb3dzKQAA/+ENnWh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bW...

But I want the same URI as file:///data/user/0/host..... How can I do this?

Thanks.

You can reproduce it here https://snack.expo.io/0vZrA4ias

Step to reproduce

Once select an image in Android mode and check Log and then upload the image in web mode.




Aucun commentaire:

Enregistrer un commentaire