I use react-native-camera
to take a picture and it will save in the mobile like
file:///data/user/0/xxx/cache/Camera/4b1bde90-fa5e-4f91-aac1-029a8b67b3fc.jpg
now I want to upload this image to server and my API scheme is as below
const formData = new FormData();
formData.append('file', file); // should be binary, but I don't know how to read image file as binary to here
formData.append('userId', 1); //
formData.append('userType', 'normal');
after searched on SO I fund some library rn-fetch-blob
and react-native-image-picker
but still don't know how to convert image to binary/blob.