Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should I create my folder for file uploads under wwwroot inside visual studio?

If I were to follow this example file uploads would be stored in the wwwroot file. It is my understanding this file is where you should store static files that will be served to the user. Sure, I want my users to be able to download but is there a filesystem, specific to asp.net core/IIS/Windows Server 2012, that would be best? I'm expecting around 10,000 files max after several years.

I'm planning on creating a folder for the uploaded documents, I'm just unsure of where to place it.

Note: The answer provided here was not sufficient

like image 637
IEnjoyEatingVegetables Avatar asked Oct 25 '25 12:10

IEnjoyEatingVegetables


1 Answers

To the best of my understanding, unless you take special precautions, files under wwwroot can be downloaded freely by users, bots, etc. with no authentication. If the files are not sensitive in nature, then there is nothing wrong with using wwwroot.

If you want to provide security at the controller level (e.g., a user can only view their own files), then it's probably better to put them elsewhere in the file system. The path is kind of arbitrary, but the security settings on the folder must be set in such a way that the dotnet process can access it. You can give Everyone full access, or be more restrictive if you see fit. This is done directly on the OS of the server, assuming that you have access to it.

like image 183
Dave Smash Avatar answered Oct 27 '25 01:10

Dave Smash



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!