Put it in the database, but the blob data type probably won't cut it. The average value is usually sufficient.
Mysql Data Types
BLOB, TEXT L + 2 bytes, where L < 216 MEDIUMBLOB, MEDIUMTEXT L + 3 bytes, where L < 224 LONGBLOB, LONGTEXT L + 4 bytes, where L < 232
I have used this several times with very good results. Be sure to save the file size as it makes it easier to extract it. Not sure if this applies to C # like PHP.
If you use prepared statements with parameters, the data will be automatically shielded by AFAIK.
Also, I see no real reason why the database itself will be slow when this data type is stored in it. The main bottleneck will be data transfer. Also, mysql sometimes limits the maximum length of requests and responses in particular.
As soon as you run it, it is pretty neat, especially when working with a large number of small files. For a small number of large files, this approach does not make sense; it is better to use some backup system to process moved / deleted files.
source share