How to use expo expo-file-system uploadAsync with asset from expo-media-library getAssetsAsync

684 Views Asked by At

getAssetsAsync returns list of assets where uri look like:

"ph://ED7AC36B-A150-4C38-BB8C-B6D696F4F2ED"

I trying to call uploadAsync const upload = await uploadAsync('http://localhost:8181/api/upload', post.image.uri);

But I receive error:

ExceptionsManager.js:180 Unhandled promise rejection Error: Cannot upload file 'ph://ED7AC36B-A150-4C38-BB8C-B6D696F4F2ED'. Only 'file://' URI are supported.

How can I fix it?

0

There are 0 best solutions below