rn-fetch-blob
rn-fetch-blob copied to clipboard
streamErr File does not exist at path
I push a path to rn-fetch-blob, but return a error about file does not exist at path
'streamErr:', { [Error: File does not exist at path file:///private/var/mobile/Containers/Data/Application/29181948-B5F9-4254-A817-5C9A4D757366/tmp/react-native-image-crop-picker/0A35F750-6D67-4952-AD6B-B796AC64464B.mp4]
code: 'ENOENT',
line: 203267,
column: 30,
sourceURL: 'http://192.168.61.121:8081/index.bundle?platform=ios&dev=true&minify=false' }
what can i do ? Crying...
Any hope on this? I'm getting a similar error
I managed to make it work. I don't know if you used document picker https://github.com/rnmods/react-native-document-picker If that's the case, you need to specify copyTo attribute because (as mentioned in the documentation) the picked files are temporary files. After that, make sure to cut 'file:///' in front of the path and it should work
After that, make sure to cut 'file:///' in front of the path and it should work
lol thanks u for solution, it's help me a lot
@fukemy @T0mAl3x Not working for me this solution and I am selecting a 2.5GB video even low size as well for this path file:///private/var/mobile/Containers/Data/App
. can you please suggest me solution.
my code
const fileUri = imageObject.replace('file://', '');
const file = await RNFetchBlob.fs.stat(decodeURIComponent(fileuri));
task = RNFetchBlob.fetch(
'PUT',
signedImageURL,
{
'Content-Type': undefined
// 'Content-Type': extension
},
RNFetchBlob.wrap(file.path)
);
// assign task
task.uploadProgress((progress, total) => {
console.log('uploadProgress ::::', Math.floor((progress * 100) / total));
progressUpload(Math.floor((progress * 100) / total));
})
.then((result) => {
console.log('result',result);
})
I managed to make it work. I don't know if you used document picker https://github.com/rnmods/react-native-document-picker If that's the case, you need to specify the copyTo attribute because (as mentioned in the documentation) the picked files are temporary files. After that, make sure to cut 'file:///' in front of the path and it should work