rn-fetch-blob icon indicating copy to clipboard operation
rn-fetch-blob copied to clipboard

ReactNativeRenderer-dev.js:9702 JSON value '{ code = ENOENT; }' of type NSMutableDictionary cannot be converted to NSString

Open Ann1995 opened this issue 6 years ago • 3 comments

		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

Screen Shot 2019-04-22 at 3 36 57 PM this is my ifStream

Ann1995 avatar Apr 22 '19 12:04 Ann1995

Any solution for this issue?

fahadibrahimbutt avatar Oct 11 '20 15:10 fahadibrahimbutt

Are any updates on this?

gurbela avatar Feb 08 '21 15:02 gurbela

any updates ?

KevinThoriya avatar Jul 23 '23 11:07 KevinThoriya