willPHPwork commented on issue #603:
URL:
https://github.com/apache/cordova-plugin-file/issues/603#issuecomment-1710057293
Thanks for the detailed explanation. I am currently looking into MediaStore.
```
function onDeviceReady() {
// Cordova is now initialized. Have fun!
console.log('Running cordova-' + cordova.platformId + '@' +
cordova.version);
document.getElementById('deviceready').classList.add('ready');
window.resolveLocalFileSystemURL(cordova.file.externalRootDirectory +
'Download', (directoryEntry) => {
directoryEntry.getFile('myFile.txt', {create: true, exclusive:
false}, (entry) => {
entry.createWriter((writer) => {
writer.onwriteend = () => {
console.log('write success');
};
writer.onerror = (e) => {
console.error('write error', e);
};
let blob = new Blob(['test123'], { type: 'text/plain' });
writer.write(blob);
}, (e) => {
console.error('writer init error', e);
});
}, (e) => {
console.error('creation error', e);
});
}, (e) => {
console.error('resolve error', e);
});
}
```
This was the method I was using as well, right now it creates a file, but
the file is empty (0kbs) with API 33 (and beyond?) / Android 13.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]