I have a folder named archive in my project and have a separate folder for each user. Sample folder structure;
Archive(Folder) => User1(Folder) => other folders => files
Archive(Folder) => User2(Folder) => other folders => files ...
I don't want a user to access other users' folders and files. I also want to prevent users who are not logged in to access the archive folder and its contents.
How can I do that?
For
Static file authorization, you could refer Static file authorization.For another option, you could write your own middleware to check the identity before
app.UseStaticFiles();.