Image is not loading in <img> tag with ftp url


#1

I am trying to show the user’s photo in my Ionic android application using the img tag as follows,

< img src=“ftp://10.132.21.100/PatientPhoto/Temp_emp.jpg” alt=“no image”/>

The image is not getting displayed in the APP (failed to load the resource error). But I can view the image if I enter the same URL(ftp://10.132.21.100/PatientPhoto/Temp_emp.jpg) in my mobile browser. I am running the debug build, so I guess it is not a permission issue. I have done white listing by adding the below line in the config.xml file,

< access origin="*"/>

I tried adding below lines too without any success,

< allow-intent href=“ftp:///” />
< allow-navigation href=“ftp:///” />

Also added Content-Security-Policy to the html file as follows, still facing the same issue.

< meta http-equiv=“Content-Security-Policy” content=“default-src *; script-src ‘self’ ‘unsafe-inline’ ‘unsafe-eval’ *; style-src ‘self’ ‘unsafe-inline’ *”>

It is working if I a use http URL for img src. The images are stored in the ftp server, so I can’t use http URL. Any suggestion is highly appreciated.


#2

Have you tried whitelisting the domain? See this thread for more information.


#3

white listing is there, still getting the issue.