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.
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.
Share Improve this question edited Nov 21, 2013 at 0:14 Shog9 160k36 gold badges235 silver badges240 bronze badges asked Nov 13, 2013 at 21:41 Taron MehrabyanTaron Mehrabyan 2,2293 gold badges21 silver badges27 bronze badges 01 Answer
Reset to default 11You 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.