yeah258258
yeah258258
  • 发布:2015-08-06 11:26
  • 更新:2017-09-21 18:33
  • 阅读:5076

plus.io.resolveLocalFileSystemURL 返回编码错误

分类:HTML5+
IO

plus.io.resolveLocalFileSystemURL 返回编码错误

文件是用plus.downloader.createDownload 下载下来的,保存的路径是/var/mobile/Containers/Data/Application/3BA94D58-35B1-4D09-B1BD-D758A6C8276D/Library/Caches/Pandora/downloads/image_thepaper_cn_www_image_4_479_46.jpg

然后使用plus.io.resolveLocalFileSystemURL去获取该文件,返回编码错误
android 上没有该问题 ,只在ios 上出现

2015-08-06 11:26 负责人:无 分享
已邀请:
yeah258258

yeah258258 (作者)

已经解决前面加个file://就可以了

janc

janc

怎么加?
[LOG] : Read success:{"type":"loadend","bubbles":false,"cancelBubble":false,"cancelable":false,"lengthComputable":false,"loaded":0,"total":0,"target":{"fileName":"/Users/janc/Library/Developer/CoreSimulator/Devices/5D2346E9-8781-420E-9E79-5439C0BBD93F/data/Containers/Data/Application/072B35AF-2936-4453-8156-32C509BB0E0C/Library/Pandora/apps/HBuilder/doc/audio/2016431463540692261","readyState":2,"result":null,"error":{"code":5,"message":"编码错误"},"onloadstart":null,"onprogress":null,"onload":null,"onabort":null,"onerror":null}}

秋天无风

秋天无风

var cacheDir = '_downloads';  
var localPath = plus.io.convertLocalFileSystemURL(cacheDir);  
console.log(plus.os.name == 'iOS');  
if (plus.os.name == 'iOS') {  
  localPath = 'file://' + localPath;  
}

该问题目前已经被锁定, 无法添加新回复