0

my application is a simple ASP.NET MVC that reads the paths of some pictures from a JSON file, and display them into a web page.

The display of the pictures is OK as long as I am hosting them under wwwroot.

My problem is : The JSON and the pictures are dynamic (periodically , not "very" dynamic therefore no need for special event treatment or callbacks or whatsoverver ), they are generated with some scripts and I need to replace them manually each time I have a new version of them.

I had the idea of having a folder in my file system, set an environment variable with its path, read that variable with the C# application and give then the paths to the HTML .

That has successfully solved the problem of the JSON file, I can read it from the correct location then deserialize it, but I cannot find a way for the images.

Is there any way to Map a Folder - with dynamic content - into the wwwroot ? or is it possible to use that folder directly as a web root folder ?

  • If you want to show contents that are outside of your website folder, you may want to look at `Virtual Directory` in IIS, you can map a url to a folder. – rjs123431 Oct 25 '22 at 17:12
  • Could you please tell me how often you will change the image file? If you want to modify it, you could directly using a network folder or else like Azure blob or else. – Brando Zhang Oct 26 '22 at 06:59
  • The folder will contain images, these images will not change so often (like 1 time per day), but they will be changed , the new images will be displayed . but this process has to be automated anyway. I am using oneDrive for this, I want to map that oneDrive folder somehow to IIS. – Macadamia1988 Oct 26 '22 at 09:01
  • Problem solved after adding a virtual folder to IIS Express – Macadamia1988 Oct 26 '22 at 09:18

0 Answers0