export fix

This commit is contained in:
libccy 2016-03-26 15:01:02 +08:00
parent c9783cb0c1
commit fe1c5adbb2
1 changed files with 2 additions and 1 deletions

View File

@ -9972,6 +9972,7 @@
var blob = zip.generate({type:"blob"}); var blob = zip.generate({type:"blob"});
var fileNameToSaveAs = packname||'noname'; var fileNameToSaveAs = packname||'noname';
fileNameToSaveAs=fileNameToSaveAs.replace(/\\|\/|\:|\?|\"|\*|\<|\>|\|/g,'.'); fileNameToSaveAs=fileNameToSaveAs.replace(/\\|\/|\:|\?|\"|\*|\<|\>|\|/g,'.');
fileNameToSaveAs+='.zip';
if(window.resolveLocalFileSystemURL){ if(window.resolveLocalFileSystemURL){
window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory,function(entry){ window.resolveLocalFileSystemURL(cordova.file.externalDataDirectory,function(entry){
@ -9980,7 +9981,7 @@
fileWriter.onwriteend=function(){ fileWriter.onwriteend=function(){
alert('文件已导出至'+cordova.file.externalDataDirectory+fileNameToSaveAs); alert('文件已导出至'+cordova.file.externalDataDirectory+fileNameToSaveAs);
} }
fileWriter.write(textFileAsBlob) fileWriter.write(blob)
}); });
}); });
}); });