Typically file servers are utilized to store images for any web application. For additional security and control you'd choose storing images in database. But this turns out to be complex and slow.

Exist other mainstream possibilities apart from db/file server, to keep images safely with user permissions, etc.

Edit: I am used on amazon . com cloud and employ postgresql as db.

SQL Server 2008 offers the Filestream storage wich enables you to definitely store data within the filesystem, yet being able to access it thorugh the database. It may be helpful in case your only anxiety about utilizing a database is performance.

If images are saved inside a folder which has no direct web access permissions after that you can do

<img src="getimage.aspx?id=1234">

and also have your GetImage "page" inflict appropraite permissions test (e.g. using session ID) after which "deliver" the look in the secure folder.

Downside would be that the image isn't cached I believe? however i expect that's the case with the database route too.

Storing images within the phyiscal database bloats the database, growing backup &lifier restore occasions but it possesses a single container that is great if you wish to move everything to a different / multiple servers, or maybe making certain referential integrity between Image along with other data within the DB is essential

Are you currently are worried about people speculating a URL and directly being able to access a picture?

If that's the case, you are able to still put the images around the filesystem, just outdoors your www directory. You produce a page known as ImageServer.php/.aspx/.jsp, grabs the look from the filesystem after which serves it in reaction to some URL like:

ImageServer.php?image=BlueWhale.png

Should you choose this, make sure properly set the MIME type and expiry headers because Apache/IIS will not get it done for you personally.