I have implemented the following code:
- Download a zip file using RNFS.downloadFile()
- Unzip the file using ZipArchive.unzip()
- Delete the zip file using RNFS.unlink()
I can send info from the server indicating how big the zip file is and how big the unpacked directory is. However, how can I detect if there is enough space on the device to download and unzip the file? I assume once I figure this out I can just do a check like this:
if (free_space_on_device > zip_size + unpacked_size){
proceed with steps 1 through 3 (listed above)
}
RNFS.getFSInfo
Doesn't take an argument : github.com/itinance/… It seems that it returns info only for the main storage. – Inclinometer