How might I learn the size of a file located in a local filesystem exposed through the HTML5 API?
I'm expecting something along the lines of,
fileSystem.root.getFile(path, { create: false }, function (fileEntry) {
// fileEntry.size - ????????
});
...to be available, but haven't found anything like it.
You need to call:
fileEntry.getMetadata(function(metadata) {
alert(metadata.size); // or do something more useful with it...
});
See the specifications for the filesystem Entry interface and Metadata interface for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With