I am trying to enable static files on an ASP.NET Core 2.0 web application. I have a bunch of files in a folder called updater which resides outside the wwwroot folder. To allow access to them I added
app.UseStaticFiles(new StaticFileOptions()
{
ServeUnknownFileTypes = true,
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), @"TestUpdater")
),
RequestPath = new PathString("/Updater")
});
This lets a different program to be able to get its files by calling the urls. The issue is all the files need to be downloaded instead of served. There is one txt file. How do I allow only download instead of it being served?