Closed
Description
Hi need help on getting the file size of a file from server before it is saved to the device storage. I need it to check if the device storage is at least twice enough for the file size to be saved.
Something like this:
var documentPath = dirs.DocumentDir;
RNFetchBlob.fs.stat(documentPath + '/sampleFile)
.then((data) => {
RNFetchBlob.fs.df()
.then((response) => {
if(response.internal_free > parseInt(data.size) * 2 ) {
//do it
}
else {
//warn
}
})
});
but fs.stat only works on files in device.. i think
Metadata
Metadata
Assignees
Labels
No labels