0
所以我卡住試圖弄清楚這一點。閱讀完成後,在FileSystem API中刪除文件?
fileEntry.file(function(file){
var reader = new FileReader();
reader.onloadend = function (e) {
var anchor = document.createElement("a");
anchor.setAttribute('href', "data:text/tsv;charset=UTF-8," + encodeURIComponent(this.result));
anchor.setAttribute("download", "log.tsv");
anchor.innerHTML = "Download Log Now";
document.body.appendChild(anchor);
alert("Download by clicking the damn link at the bottom.");
//delete the file?
}
reader.readAsText(file);
});
所以我的問題是如何在讀取文件後刪除文件?我已經嘗試過在fileEntry.remove(function(){console.log("File Removed.")});
的地方發表評論,但那是行不通的。
任何想法?
一個.remove()接受一個錯誤回調作爲第二個參數。錯誤消息說什麼? – devio
它什麼也沒說。這就像整個事情根本不能運行。 –