When I try to create a media folder inside the presistent folder of a windows 10 cordova app I'm getting the following error when debugging with Visual Studio in the JavaScript console:
Exception is about to be caught by JavaScript library code at line 314, column 13 in ms-appx-web://appname/www/cordova.js 0x800a138f - JavaScript runtime error: Unable to get property 'error' of undefined or null reference
The code I used to create a folder is the following:
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) {
//success
var directoryEntry = fileSystem.root; // to get root path of directory
//create directory
directoryEntry.getDirectory("media", { create: true, exclusive: false }, function(parent) {
//directory created successfully
console.log("/media created");
}, function(parent) {
//failed to create directory
console.log('no folder created');
}); });
User contributions licensed under CC BY-SA 3.0