ios上无法进行下载。
打印task对象为:{"id":"dt61483421882335","url":"http://qualitycheck.chinalinkhouse.com/Uploads/Offline/Zip/alldata/1479437264b4574200b33ba95cd39fac3b55684806/1479434566d60f9943ab90403357e824c524174777.zip","downloadedSize":0,"totalSize":0,"options":{"filename":"_doc/offtemp/1479434566d60f9943ab90403357e824c524174777.zip"},"filename":"_doc/offtemp/1479434566d60f9943ab90403357e824c524174777.zip","method":"GET","timeout":120,"retry":3,"retryInterval":30,"priority":1,"onCompleted":null,"eventHandlers":{"statechanged":{"type":"statechanged","handles":[null],"capture":false}},"data":null,"requestHeaders":{},"responseHeaders":{},"noParseResponseHeader":null,"cacheReponseHeaders":{},"state":0}
代码片段:
dtask = plus.downloader.createDownload(down_url, options);
dtask.addEventListener("statechanged", function(task, status) {
console.log(JSON.stringify(task));
switch(task.state) {
case 1: // 开始
break;
case 2: //已连接到服务器
break;
case 3: // 已接收到数据
var current = parseInt(100 * task.downloadedSize / task.totalSize);
owner.param.contactProcess(projectid, current);
break;
case 4: // 下载完成
//解压缩
owner.decompressProject(projectid, filePath, needupdate, callback);
break;
}
});
dtask.start();
zhongjie_yang (作者)
没有啊,说是在manifest.json里面配置关闭ats,但还是没法用
2017-01-05 09:32