$ ionic cordova plugin add cordova-plugin-file
$ npm install @awesome-cordova-plugins/file
This plugin implements a File API allowing read/write access to files residing on the device.
The File class implements static convenience functions to access files and directories.
import { File } from '@awesome-cordova-plugins/file/ngx';
constructor(private file: File) { }
this.file.checkDir(this.file.dataDirectory, 'mydir').then(_ => console.log('Directory exists')).catch(err =>
console.log('Directory doesn't exist'));
This plugin is based on several specs, including : The HTML5 File API http: // The (now-defunct) Directories and System extensions Latest: http: // Although most of the plugin code was written when an earlier spec was current: http: // It also implements the FileWriter spec : http: //

Supported platforms

  • Android
    • Browser
    • iOS
    • macOS
    • Windows
Copy link
On this page
Usage Documentation
Supported platforms