@ionic/angular 4.0.0-beta.13:不允许加载本地资源:使用 webview 2.2.3 - Ionic CLI 4.3.1 [英] @ionic/angular 4.0.0-beta.13 : Not allowed to load local resource : with webview 2.2.3 - Ionic CLI 4.3.1
问题描述
从相机拍摄照片后,这些路径来了.
After taking the photo from camera, these paths come.
file:///data/data/xxx.xxx.xxx.xxx/files/1542782360167.jpg
我用的是Ionic 4,其中WebView是2.2.3,通过应用观察到所有类型的回复,但没有效果.
I use Ionic 4 in which WebView is 2.2.3, all types of replies have been observed by applying but no effects came.
"cordova-plugin-ionic-webview": "2.2.3"
我曾经回答过这个问题
所以我没有在设备上显示这个应用程序,这个和这个不一样.
So I do not show the application on the device and this one is not the same.
Failed to load resource: net::ERR_FILE_NOT_FOUND
推荐答案
我已经找到了我的问题的解决方案.
I have found the solution of my problem.
我已经完成了这个链接,效果很好.
I have done this link which is working perfectly.
https://devdactic.com/ionic-4-image-upload-存储/
而在我的 config.xml 中,extra 没有写任何东西.
And in my config.xml, extra did not write anything.
简而言之:新的 webview 插件不支持 file:///url
inshort :
new webview plugin are not support file:/// url
首先将url
转成http://localhost:
使用这个函数 this.webview.convertFileSrc(img);
first convert url
into http://localhost:<post>/url
using this function this.webview.convertFileSrc(img);
像这样返回这个函数值http://localhost:8080/_file_/data/data/xxx.xxx.xxx.xxx/files/1542782360167.jpg
我的建议使用上面的链接解决同类问题...
my suggestion use above link for same kind of problem...
这篇关于@ionic/angular 4.0.0-beta.13:不允许加载本地资源:使用 webview 2.2.3 - Ionic CLI 4.3.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!