Wednesday 15 January 2014

ionic framework - Cordova read directory contents -



ionic framework - Cordova read directory contents -

is there way utilize cordova read contents of directory? i'm working on remote file browser download files specific directory.

i want able read 'downloads' folder.

is possible?

i've found ways of reading+writing files, , writing directory - no way of reading contents of directory.

to read directory can utilize $window service

you may need wrap in $ionicplatform.ready(callback)

$window.resolvelocalfilesystemurl( 'dir_you_want_to_read', function (direntry) { var dirreader = direntry.createreader(); dirreader.readentries( function (entries) { console.log(entries); // directory entries }, function (err) { console.log(err); } ); }, function (err) { console.log(err); } );

resolvelocalfilesystemurl returns direntry, can create reader entry list content, entries combination of direntries , fileentries.

i couldn't find documentation about, figured out doing console.log($window) , looking @ examples. here 1 example

cordova ionic-framework

No comments:

Post a Comment