tags:

views:

69

answers:

3

Typically file servers are used to store images for a web application. For more security and control you'd go for storing images in database. But this proves to be complex and slow.

Are there other mainstream options available other than db/file server, to store images securely with user permissions, etc.

Edit: I'm deployed on amazon cloud and use postgresql as db.

+2  A: 

SQL Server 2008 offers the Filestream storage wich allows you to store data in the filesystem, yet accessing it thorugh the database. It can be useful if your only concern with using a database is performance.

Konamiman
thanks @Konamiman Currently I'm deployed on amazon cloud and use postgresql as the database.
Satya
A: 

Are you are concerned about people guessing a URL and directly accessing an image?

If so, you can still place the images on the filesystem, just outside your www directory. You create a page called ImageServer.php/.aspx/.jsp, grabs the image off of the filesystem and then serves it in response to a URL like:

ImageServer.php?image=BlueWhale.png

If you do this, be careful to correctly set the MIME type and expiry headers because Apache/IIS won't do it for you.

ctford
+1  A: 

If images are stored in a folder that has no direct web access permissions you can then do

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

and have your GetImage "page" do any appropraite permissions test (e.g. using session ID) and then "deliver" the image from the secure folder.

Downside is that the image is not cached I think? but I expect that is true of the database route too.

Storing images in the phyiscal database bloats the database, increasing backup & restore times; but it provides a single container which is great if you want to move everything to a new / multiple servers, or if ensuring referential integrity between Image and other data in the DB is important

Kristen