返回介绍

Ionic4 文件插件-文件File

发布于 2019-11-23 07:40:59 字数 2070 浏览 1199 评论 0 收藏 0

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.

Example:

import { File } from '@ionic-native/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: //www.w3.org/TR/FileAPI/ The (now-defunct) Directories and System extensions Latest: http: //www.w3.org/TR/2012/WD-file-system-api-20120417/ Although most of the plugin code was written when an earlier spec was current: http: //www.w3.org/TR/2011/WD-file-system-api-20110419/ It also implements the FileWriter spec : http: //dev.w3.org/2009/dap/file-system/file-writer.html @interfaces IFile Entry DirectoryEntry DirectoryReader FileSystem

https://github.com/apache/cordova-plugin-file

Ionic 文件File插件的安装(Installation)

ionic cordova plugin add cordova-plugin-file npm install @ionic-native/file 
Ionic EE comes with fully supported and maintained plugins from the Ionic Team. Learn More or Contact Us
ionic enterprise register --key=YOURPRODUCTKEY npm install @ionic-enterprise/file 

Ionic 文件File插件支持的平台(Supported Platforms)

  • Android
  • Browser
  • iOS
  • macOS
  • Windows

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文