2

Hey in my MVC project in wwwroot I have a folder called "Avatars" with some jpg files in it. each user has a link in the db. So for example user with id 1 has a value in table of "https://www.somelink.com/Avatars/1.jpg". The problem is when I load the program my img element looks like this:

<img class="image" src="unsafe:www.somelink.com/Avatars/16025.jpg">

Why I am getting this "unsafe:" at the beginning of the src link? What does it mean and how can I fix this?

Update 1:

So I got asked for the code where I'm emitting my image.

<img class="image" [attr.src]="profilePicture" />

profilePicture is just loaded value from database and if no value found, no image is loaded, so there is nothing much to show... And yes I am using Angular2..

Muqeet Khan
  • 2,094
  • 1
  • 18
  • 28
Nikas Žalias
  • 1,594
  • 1
  • 23
  • 51
  • Please show the code that you are using to emit the image tag. – RonC Jun 05 '17 at 12:50
  • I feel the unsafe is coming from Angular and not ASP.NET Core. Can you try adding http:// or https:// to the URL you get from the DB? – Muqeet Khan Jun 05 '17 at 15:04
  • I think you need to mark it as safe like sown in https://stackoverflow.com/questions/37076867/in-rc-1-some-styles-cant-be-added-using-binding-syntax/37076868#37076868 – Günter Zöchbauer Jun 05 '17 at 16:08

0 Answers0