|
使用file插件创建持久化文件,使用getFile方法时候出错,
//录音完成
Model.prototype.endClick = function(event){
voice.stopRecord({
success : function(res) {
audioUrl = res.localId;
alert(audioUrl);
//系统文件获取
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function (fs) {
console.log(fs);
fs.root.getFile(audioUrl, { create: true, exclusive: false }, function (fileEntry) {
console.log("fileEntry is file?" + fileEntry.isFile.toString());
// fileEntry.name == 'someFile.txt'
// fileEntry.fullPath == '/someFile.txt'
writeFile(fileEntry, null);
}, onErrorCreateFile);
}, onErrorLoadFs);
},
fail : function(res) {
console.log("录音完成失败了: "+JSON.stringify(res));
}
});
};
function onErrorCreateFile(error){
//执行到这里,出错信息error = {
code:5
}
}
怎么回事?,小白搞不懂了,大牛快来看看 |
|