I am trying to upload an image as binary. I used rn-fetch-blob library for this one. Because normal fetch gives network errors.
const path = file.path.replace('file://', '');
const uploadPath = RNFetchBlob.wrap(path);
RNFetchBlob.fetch(
'PUT',
SERVER_URL,
uploadPath,
)
.then(res => {
console.log('image uploaded res ---> ',res);
})
.catch(err => {
console.log(err);
});
it uploads an empty stream and the server stores a zero-byte size file. Any solution for this issue?