tags:

views:

41

answers:

2

Hi all,

I'm constructing a new cms with the option to create reviews and articles (blog items). Now if the user wants to write a review he/ she will want to add a lot of images in the text. Now my question to you is , what would be the best option to include those images (with keeping in mind that a CDN can be used later).

I was thinking of the following methods:

  1. Break an article in multiple blocks, each block can then include a picture and text.
  2. Just add the picture in the text via WYSIWYG editor (easiest option but not so versatile)
  3. Upload images separately and include them via tags in article text. Like

    Title

    {img_1}

    Content

How do you guys (and girls) do these things?

Thanks for your time

A: 

(1) is horrible and your users will hate you for it.

(2) won't "just work" - you'll have to implement some kind of image upload/storage/serving mechanism

(3) isn't such a bad idea...

In terms of image storage, if you are using SQL Server, don't forget FILESTREAM http://technet.microsoft.com/en-us/library/bb933993.aspx

tomfanning
Thanks you for your answer. I do know how to store images I was just in need for some takes on what's the best solution. Especially since the site must be easy connected to a CDN. I would never recommend image store in SQL though especially since SQL space is kinda limited and with lots of requests it will go slowww while a CDN serves from a server based on user location and as a personal preference I would like to have my pictures in folder structures.
Mark
This wasn't supposed to be the focus of my answer, but FILESTREAM data is stored on the file system, not in the database itself - that's the point of it. It's just a way of referencing your images from the database in a relational way. Point taken about the CDN though.
tomfanning
+1  A: 

I think a combination of options 2 and 3 might provide a good balance. You could allow the users to upload the images they will use in their article/review. Then use an enhanced text editor (like the one that Stack Overflow uses for questions & answers) to write the article and embed the pictures.

In the Stack Overflow editor you have to enter a URL for the image you would like to embed. You could simplify this since the user has uploaded the picture and you know where it is. A small piece of UI could allow them to select the image they want to embed. You could then take the selection, determine the image url and inject it into the editor.

John Gully
Thank you for your answer, I think I'm opting for the 2 and 3 solution like u suggested.
Mark