Closed tonvlad88 closed 1 year ago
Hi man! Thanks for the feedback!
I was looking the bug and i found some related issue (https://github.com/expo/expo/issues/15664) happens only in iOS, for some reason the uri starts in ph:// instead of file:// with the local uri of the file.
You can use the method getAssetInfoAsync
from expo-media-library
(https://docs.expo.dev/versions/latest/sdk/media-library/#medialibrarygetassetinfoasyncasset-options) and check if the localUri
is the local uri of the file. Let me know if that works
Hi man! Thanks for the feedback!
I was looking the bug and i found some related issue (expo/expo#15664) happens only in iOS, for some reason the uri starts in ph:// instead of file:// with the local uri of the file.
You can use the method
getAssetInfoAsync
fromexpo-media-library
(https://docs.expo.dev/versions/latest/sdk/media-library/#medialibrarygetassetinfoasyncasset-options) and check if thelocalUri
is the local uri of the file. Let me know if that works
Thanks @mdjfs, using the localUri
from expo-media-library resolved this issue. You can close this ticket. You are really awesome!
Hello @mdjfs,
I am new to react native and I did find your package (it was really awesome). Now, I tried to use the returned asset object to upload the selected images to the server but it seems it is not working well. Below is the sample return of the object after I selected one or more pictures in my gallery:
I used the uri.uri as my file in the formData but it will crash the app.
I have tried the expo-image-picker (sadly it only allows 1 image) and it gives me this different uri (see below) which allows me to upload the selected picture.
Do you have any idea about this? Hope you can share some time. Thank you
Device used: iPhone 7+
Screenshot:
An additional discussion here (not sure if it's related): https://forums.expo.dev/t/no-suitable-url-request-handler-found-for-ph-upload/60049/2
I also installed the mime package and get the type of the URI as mentioned here https://stackoverflow.com/questions/70337776/expo-sdk-43-no-suitable-url-request-handler-found-for-ph-upload but still got the error