小编Osc*_*out的帖子

Cordova:无法使用Cordova在Android上复制文件

在尝试设置以下权限时,我不知何故得到"错误代码5".我想要做的是将现有文件从android中的资产复制到Android设备上的可访问位置,以便能够在其他应用程序(如邮件)之间共享它.

这是我的代码示例:

    window.requestFileSystem  = window.requestFileSystem || window.webkitRequestFileSystem;
    var storagefolder = cordova.file.dataDirectory;
    var storagefolderpointer;
    console.log("storage folder: " + storagefolder);

    // Check for support.
    if (window.requestFileSystem) {
        console.log("filesystem beschikbaar");
        var getFSfail = function () {
            console.log('Could not open filesystem');
        };
        var getFSsuccess = function(fs) {

            var getDIRsuccess = function (dir) {
                    console.debug('Got dirhandle');
                    cachedir = dir;
                    fileurl  = fs.root.fullPath + '/' + storagefolder;
                    storagefolderpointer = dir;
            };
            var getDIRfail = function () {
                console.log('Could not open directory');
            };

            console.debug('Got fshandle');
            FS = …
Run Code Online (Sandbox Code Playgroud)

javascript android webkit asp.net-web-api cordova

6
推荐指数
1
解决办法
439
查看次数

标签 统计

android ×1

asp.net-web-api ×1

cordova ×1

javascript ×1

webkit ×1