Hey folks, I’m working on using the file and file-transfer plugins in my Ionic app.
I followed the examples and whenever I attempt to create a directory or file I get this error:
It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources.
I get an error with the file transfer plugin but it just states code:1
Here is my code:
this.file.checkDir(this.file.dataDirectory, 'media').then(() => {
// Media Directory Exists, do nothing.
console.log('Media Storage Loaded');
}).catch(err => {
console.log('Media Storage not found... Creating');
this.file.createDir(this.file.dataDirectory, 'media', false).then(dir => {
console.log('Media Directory Created!');
}).catch(err => {
console.log('CRITICAL ERROR. MEDIA STORAGE DIRECTORY FAILED TO BE CREATED:', err);
console.log('Because of this, media files cannot be stored or loaded locally');
});
});
Now, I know the browser is a different platform but it’s clear that a proxy is firing and I can see not only the file-plugin-ready
events but I went through the Preparing.js
and saw it creates a local FS as well.
I went to the cordova-file-plugin
repo itself, and used it’s samples (which are basic File API) and when I request my own fs they work just fine. Something in the ionic-native
wrapper isn’t working correctly…
I’m on the latest with Ionic and Ionic-Native.
I submitted an issue to the ionic-native
repo HERE
Has anyone else gotten the plugin to work on the Browser??