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

streamErr File does not exist at path

Open GuiltyKirito opened this issue 4 years ago • 4 comments

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...

GuiltyKirito avatar Feb 26 '20 07:02 GuiltyKirito

Any hope on this? I'm getting a similar error

T0mAl3x avatar Nov 19 '20 15:11 T0mAl3x

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

T0mAl3x avatar Nov 19 '20 16:11 T0mAl3x

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 avatar Jun 29 '22 15:06 fukemy

@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

codal-mpawar avatar Jul 13 '23 06:07 codal-mpawar