0

I want to show a image in my Frontend but I need to go to a different folder in order to do it For example, in this response i get

idAchievement:19
description:    "Kill 50 monsters"
medal:"mage212952795.png"
type:"Kills"
value:50

and the picture that I want to show is in the attribute medal. But the path to the folder where the images are stored in the backend is \shooterland\Website\Backend\shooterlandWebBack\shooterlandWebBack\Image while my Frontend is in the path \shooterland\Website\Frontend\src\app\achievement-list. How can I go the the desired path?

I run dotnet run in this folder enter image description here

Fábio Pires
  • 89
  • 1
  • 2
  • 10

1 Answers1

1

As far as I know, you shouldn't be directly accessing images stored in the backend directory. Depending on the type of backend you are using, you can host static files on the backend and access them using the backend API URL.

Assuming your backend is running on port 8000 on localhost and you are sharing files on your backend in some public folder, you should write something like this

<img src="http://127.0.0.1:8000/public/mage212952795.png" alt="">

If you still want to access files stored on the folder outside your project directory directly, you can do it as described in here