MVC and user uploaded files, where to store files?

I am having trouble choosing where to store files uploaded by a user in my asp.net mvc application.

I have been using asp classic for about 10 years and always keep files on disk on the site and save the file and folder names in the database.

How do you guys approach this issue?

Having them in the database can a performance problem arise? or leave it the way I always did, and there may be a problem with the "sync" file system and db?

I must have some kind of relational information in the database, so I can’t only store them on disk

I am using sql 2005 atm, and I read somewhere that sql 2008 has some kind of datacolumn that now stores a "pointer" (like text data type) for a file on disk, is that the path

To some extent, the database is called a database for some reason, so I'm not sure why reinvent the wheel again? :)

Any pointers or ideas would be appreciated, I think I'm just curious about the problems that I might run into if I go with the database approach

/ M

+3
source share
2 answers

You can use a special folder App_Datato place downloaded files and save the path in the database. If you upgrade from SQL Server 2008, you can take a look at the FILESTREAM type .

+2

, - , , , SAN , - . , , , , ( GUID ). , , , .

+1

Source: https://habr.com/ru/post/1726037/


All Articles