How to get the file size using Javascript in Chrome extensions?
How can I get the size of file written in a sandboxed sect开发者_JS百科ion of chrome using javascript ?
It is not amazingly easy.
The FileEntry and Entry interface has a method called getMetaData, but this doesn't include the file size. The only way that I could work out how to do it is as follows:
- Get the file entry
- Call file, to get a reference to the file, the file is of type Blob.
- Read blob.size
It means potentially loading the file.
精彩评论