Phonegap / Cordova - 将音频文件移动到创建的目录

时间:2017-06-30 07:39:31

标签: cordova phonegap-plugins cordova-plugins phonegap

我正在使用Phonegap,我正在使用Cordova File插件。我能够在iPhone中创建目录。现在我想将录制的音频移动到该目录。

以下是创建目录的代码。请建议我如何将文件移动到此目录。

   function FeedVoicesave(callback, appendData) {
    alert("save");
    OnCallback = callback;
    OnAppendData = appendData;
    window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, FeedVoicefail);
}

function gotFS(fileSystem) {
    fileSystem.root.getDirectory("Newfolder", {create: true},gotDir)
}


function gotDir(dir) {
    alert("Created dir "+dir.name);
    alert("Created dir " + dir.fullPath);
    alert("Created dir NativePath" + dir.nativeURL);
}

0 个答案:

没有答案