download(): void {
window['resolveLocalFileSystemURL'](window['storageLocation'],
function (fileSystem) {
fileSystem.getDirectory('Download', {
create: true,
exclusive: false
},
function (directory) {
directory.getFile('Договор ОУ', {
create: true,
exclusive: false
},
function (fileEntry) {
fileEntry.createWriter(function (writer) {
writer.onwriteend = function () {
console.log('File written to downloads');
};
writer.seek(0);
writer.write(this.blobAddress); // You need to put the file, blob or base64 representation here.
});
});
});
});
}