Quantcast
Channel: Active questions tagged react-native+android - Stack Overflow
Viewing all articles
Browse latest Browse all 28479

React native: how to get file size, mime type and extension?

$
0
0

I know react-native-fs and react-native-fetch-blob, but I'm missing simple helper functions like getFileInfo(file).

Desired pseudo code:

let fileInfo = getFileInfo('path/to/my/file.txt');
console.log('file size: ' + fileInfo.size);
console.log('mime type: ' + fileInfo.type);
console.log('extension: ' + fileInfo.extension);

What's the proper way to get the file size, mime type and extension?

Thanks in advance!


Viewing all articles
Browse latest Browse all 28479

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>