Using org.apache.cordova.file plugin I can selected the file and I get the native path of the file. After that I have to restrict the user to select the file according to there file size. But I can't get that file size. My problem is that I can't get the file Size using that plugin. For this I am using this tutorial.
To get file size, you need to access it via metadata as follows:
window.resolveLocalFileSystemURL(filePath,
function (fileSystem) {
fileSystem.getFile(fileName, {create: false},
function (fileEntry) {
fileEntry.getMetadata(
function (metadata) {
alert(metadata.size); // get file size
},
function (error) {}
);
},
function (error) {}
);
},
function (error) {}
);
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