itinance / react-native-fs

Native filesystem access for react-native
MIT License
4.89k stars 954 forks source link

The operation couldn’t be completed. No space left on device #1205

Open nijarv opened 7 months ago

nijarv commented 7 months ago

I'm encountering an issue with the react-native-fs (version 2.20.0) where I receive an error message saying "The operation couldn’t be completed. No space left on device" even though there are GBs of space available on the device. This issue occurs when I attempt to download images and videos. Any assistance or insights into this issue would be greatly appreciated.

Environment:

Code Snippet:

Here's a snippet of the code that triggers this error:

let path = RNFS.DocumentDirectoryPath + '/image.png';

RNFS.downloadFile({ fromUrl: eachTemplate.uri, toFile: path }).promise.then((resp) => {
    if (resp.statusCode === 200)
        setImagePath(path);
}).catch((err) => {
    console.log(err);
});

Error Message:

The operation couldn’t be completed. No space left on device

Steps to Reproduce:

Ensure the device has ample storage space. Attempt to download an image or video file using the downloadFile method from react-native-fs. Expected Result:

The file should download successfully without any errors since there is sufficient storage space on the device.

Actual Result:

The error message "The operation couldn’t be completed. No space left on device" is displayed.

I look forward to your suggestions and help. Thanks in advance!