I am trying to serve files from my images folder inside the wwwroot folder of my ASP.NET Core application where I have already enabled static files access in the Startup
class.
The HostingEnvironment
service provides me with a WebRootPath
property that provides me with an absolute path to the wwwroot folder but using this path gives me a "Not Allowed to load local resource" error in my browser's console.
If I access the file from my browser using localhost
+ the relative path I am able to get the image file so there is no issue about authorization.
All I need now is to be able to convert that absolute path into a relative one to my web server.