angularjs - Get selected file size using org.apache.cordova.file -


using org.apache.cordova.file plugin can selected file , native path of file. after have restrict user select file according there file size. can't file size. problem can't file size using plugin. using this tutorial.

to file size, need access via metadata follows:

            window.resolvelocalfilesystemurl(filepath,                  function (filesystem) {                     filesystem.getfile(filename, {create: false},                          function (fileentry) {                             fileentry.getmetadata(                                 function (metadata) {                                     alert(metadata.size); // file size                                 },                                  function (error) {}                             );                         },                          function (error) {}                     );                 },                  function (error) {}              );      

Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -