如何在我需要的地方存储图像和文件坚持在角度nativescript中的根文件夹

时间:2018-11-22 07:56:12

标签: angular filesystems angular2-nativescript

如何在需要的地方存储图像和文件,必须在有角度的本机脚本中保留根文件夹

    const xdocuments: Folder = <Folder>knownFolders.documents();
    const xfolder: Folder = <Folder>xdocuments.getFolder("testFolder");
    const tempExists: boolean = Folder.exists(xfolder.path);
    const xfile: File = xfolder.getFile("test.pdf");
    var pdfdata = "xyzbase64string"
    let binaryString = pdfdata;
    xfile.writeTextSync(binaryString, err => {
        console.log("Error saving file");
    }, TextModule.encoding.ISO_8859_1);
    console.log("possible creating file");

0 个答案:

没有答案