|
确实有问题,页面上png文件显示不了。用existSync探测是成功的
html:
<div>
<span><input type="button" value='test' onclick="testButton();"></span>
<span><img src="../1.png" /></span>
</div>
代码:
function testButton() {
var fsDir = api.fsDir;
api.download({
url: "http://**.**1.z0.glb**.**/apicloud/99309c2ebcca15b1ca584d999cc09659.png",
savePath: 'fs://1.png',
report: true,
cache: true,
allowResume: true
}, function(ret, err) {
if (ret) {
console.log(JSON.stringify(ret));
var fs = api.require('fs');
var ret = fs.existSync({
path: 'fs://1.png'
});
console.log(JSON.stringify(ret));
} else {
console.log(JSON.stringify(err));
}
});
日志:
{"state":1,"fileSize":3958,"percent":100,"progress":100,"savePath":"/storage/emulated/0/UZMap/A6060432033316/1.png","contentType":"image/png"} at messageCenter.html : 107
{"exist":true,"directory":false} at messageCenter.html : 113 |
|