native-script 处理文件新功能
此模块为您提供了下载文件、选择保存文件夹并打开应用程序以打开文件的工具。
npm i --save native-script 处理文件新功能

native-script 处理文件

此模块为您提供了下载文件、选择保存文件夹并打开应用程序以打开文件的工具。

安装

tns plugin add nativescript-handle-file

如何使用

导入类并实例化。

import {HandleFile} from 'nativescript-handle-file';

let handleFile = new HandleFile();
handleFile.open({
name : "name-of-file.extension",
url: "path-to-file",
directory: "directory to save", // only in android [downloads, pictures, movies, music]
tittle: "title to choose apps" // only in android
}).then(result => {
//return true if success
})