|
5金币
本帖最后由 高飞 于 2016-5-24 03:53 编辑
saveFile:function(appFlieData,fileName,fileType,isOpen)
{
var self=this;
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
//获取Iwork目录,如果不存在则创建该目录
function gotFS(fileSystem) {
debugger;//跟踪成功执行
newDir = fileSystem.root.getDirectory("Iwork", {create : true,exclusive : false}, createFile, fail);
}
function createFile(newDir) {
debugger;//跟踪成功执行
newDir.getFile(fileName, {
create : true,
exclusive : false
}, gotFileEntry, fail);
}
function gotFileEntry(fileEntry) {
debugger;//跟踪成功执行
fileEntry.createWriter(gotFileWriter, fail);
}
function gotFileWriter(writer) {
debugger;//跟踪成功执行
writer.onwrite = function(evt) {
debugger;//没有执行
if(isOpen)
{
cordova.plugins.fileOpener2.open(
'/sdcard/Iwork/'+fileName,
fileType
);
}
else
{
justep.Util.hint("文件已经成功保存到/sdcard/Iwork/"+fileName);
}
};
writer.seek(0);
writer.write(self.b64toBlob(appFlieData,fileType, 512));
}
function fail(error) {
debugger;//没有执行过
justep.Util.hint(error.code);
}
}
};
在真机上调试,没有任何错误提示,手机上“Iwork”这个文件夹也找不到,请教高手。
此问题在普通版已经问过了,但没有得到解决,普通版的地址
http://bbs.wex5.com/forum.php?mod=viewthread&tid=93566&extra=
|
最佳答案
查看完整内容
解决方案参考: http://docs.wex5.com/wex5-app-question-list-4005/
|