Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Image Path not working through my Backend to Frontend

I am trying to get photos from my back-end and display it on my website.
Here as you can see my images are stored in my api and the path needs to be localhost:44333/Images/[imagename]

My image path

In the other hand i added my path dynamicly to my frontend as you can see below.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

But my photo never showed up on my site.
enter image description here
And when i go the image url it looks fine as you can see below:
enter image description here
I tried too many different paths but it is not working. I tried normal paths from the internet or the asset file it works when i do that but i can not get my photos from my backend localhost to my front-end.

>Solution :

Add app.UseStaticFiles("/wwwroot"); method in program.cs file
enter image description here

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading