首页 文章

从绝对URL读取图像文件时的ENCODING_ERR

提问于
浏览
1

关于如何在 iPhone Simulator 上使用Ionic 3上传图像文件,我正在关注this guide . 但是我坚持从控制台打印出来的这个错误

{“code”:5,“message”:“ENCODING_ERR”}

代码如下:

this.file.resolveLocalFilesystemUrl(dto.image)
        .then((entry: FileEntry) => entry.file(file => {
          const reader = new FileReader();
          reader.onloadend = () => {
            //do something
          };
          reader.readAsArrayBuffer(file);
        }))
        .catch(err => console.log(JSON.stringify(err)));

dto.image的值是:

/Users/myUsername/Library/Developer/CoreSimulator/Devices/05972D1E-F805-46E4-B164-BB95F116697A/data/Containers/Data/Application/1096409B-6FA3-4660-97AE-EAF3E2472046/tmp/cdv_photo_013.jpg

我正在使用ionic native File plugin

提前致谢 .

1 回答

相关问题