How can I replace/modify the image saved in storage through react native?

I want to save the modified image (output of api) in the same path as the input path. Is there a way to do this in react native? Below is what I am doing..,however this throws error.

uri = "file:///storage/emulated/0/DCIM/Camera/IMG20220224191819.jpg"
const result  = await RNFS.readFile(uri, 'base64')
    .then(res =>{
      console.log(res);
      return res;
    })

    axios({
      method: 'post',
      url: "some api url",
      data:{
        'text':result
      }
    }).then((response) => {
      console.log(response.data.text);
      RNFS.writeFile(uri, response.data.text, 'base64')
      
      
    });