What is the best way to upload a custom portrait

Is it stored in a database or file system?

And I need several different sizes. for example 128 * 128, 96 * 96, 64 * 64, etc.

What's the best way to upload a custom portrait?

0


a source to share


2 answers


Without knowing all your limitations, I would upload a 128x128 image and then create all the other portraits on the fly.



I don't think you need to worry about storing images in the DB, especially if you are using SQLServer 2008 (and you are using the new FILESTREAM type).

+1


a source


It definitely depends on the number of images that need to be stored.

If you store them on the filesystem, you just need to store the url or image location in the database. To resize, you can do so in real time, using components to achieve changes depending on the language you are using. For .NET ASPjpeg is very good, but you can manipulate the image using the System.Drawing.Imaging class. There is no need to manage database data fields or BLOB fields.



On the other hand, storing images in a database can make it too large to back up or load depending on the number of records, even if you are running SQL Server but have everything in one place. Service is faster.

The problem with storing images in the file system is the cleanup procedure, if you delete the entry, you need to delete the image in the file system as well to prevent garbage from being saved.

0


a source







All Articles