rn-fetch-blob
rn-fetch-blob copied to clipboard
ReactNativeRenderer-dev.js:9702 JSON value '{ code = ENOENT; }' of type NSMutableDictionary cannot be converted to NSString
ImagePicker.showImagePicker(options, response => {
let data = new Array<number>();
try {
const uri = response.uri;
const stream = RNFetchBlob.fs.readStream(uri, 'ascii', 102400);
stream.then(ifStream => {
console.log(ifStream);
ifStream.open();
ifStream.onData(stream => {
try {
if (typeof stream !== 'string') {
stream.forEach(element => {
data.push(element);
});
}
} catch (ex) {
Message.showError(ex);
}
});
ifStream.onError(err => {
Message.showError(err);
});
ifStream.onEnd(() => {
// read all file
const namePath = response.path!;
console.log(namePath);
const nameFile = namePath.substr(namePath.lastIndexOf('/') + 1);
let chunkAmount = 10;
const chunkSize =
response.type == 'image/jpeg'
? 4096
: Math.ceil(data.length / chunkAmount);
});
});
} catch (except) {
Message.showError(except);
}
});
when I try ifStream.onData(stream => {...}) => I get error but only in ios
ReactNativeRenderer-dev.js:9702 JSON value '{ code = ENOENT; }' of type NSMutableDictionary cannot be converted to NSString
this is my ifStream
Any solution for this issue?
Are any updates on this?
any updates ?