I'm building a small app and want to access files (images) from a directory outside the project but on the same server the app will be running.
How can I access the directory I want?
I'm building a small app and want to access files (images) from a directory outside the project but on the same server the app will be running.
How can I access the directory I want?
I used this in Startup.cs inside Configure:
app.UseFileServer(new FileServerOptions()
{
FileProvider = new PhysicalFileProvider(env.ContentRootPath + "/Albums"),
RequestPath = new PathString("/Albums"),
EnableDirectoryBrowsing = true
});
And from Model that should be using it:
Initialize(_environment.WebRootPath + "/Albums");