views:

49

answers:

3

I've got two web sites (written in c#) which are pretty common:

  • One is an admin site (cms) where you add images into content as needed, through editor pages.
  • Second is the site where the content with images is shown.

Images should be stored outside these two sites but where and how?

A: 

Have you considered storing your images on something like Amazon S3? You could then access the images from both sites. Somehow, though, you'll need to store the URLs to the images and make them available for both sites.

If both sites run off of the same database, this is fairly easy, however, if they are separate databases, then I would suggest creating some sort of API on the creation site so that the content site can easily discover which images are available to be shown.

Topher Fangio
+1  A: 

You can store images inside a database. There are plenty of tutorials on how to store images in a database (images in mysql php, images in mysql asp.net, etc). The language isn't important, any of the tutorials can help show how to store images inside the database itself. Then it's just a matter of language specific calling the image out to display it.

NebuSoft
+5  A: 

You could store them on a third site for static content, then both sites would link to that content. That can give you some benefits if you really need scalability as well.

However, you may also store it in a shared database, or just a shared file share, that you have encapsulated logic that each sites that needs access to them uses.

If you dont want to both with the storage there are many "cloud" storage servers that will host all your images for you. (like Amazon S3, Smugmug, flickr). But then you will have to build the logic in your app to upload the submitted images to your 3rd party storage provider.

Development 4.0