March 25, 2003 at 7:44 am
I deal with a lot of content management systems and one trick that impresses me is the ability to store images (GIF, JPEG etc) within a database and render the image directly from the database without saving it as a file first!
Does anyone know how this is done?
March 25, 2003 at 8:07 am
My guess would be that they just store the binary data of the image in SQL Server, then when someone requests it they return it through an ADO Stream object. Is it ASP? All objects that implement IStream (I think it is that interface) can stream directly to the client response in ASP. Quite useful with for instance images from databases, or streaming XML directly to client.
--
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
March 25, 2003 at 8:12 am
One of the many CMS's is called OBTREE. There are no physical files at all.
Absolutely everything is stored within a database and served out to pages via an ISAPI filter.
Text, graphics and everything else is stored within the database, and although you access it via a url, the url doesn't actually exist as a physical entity on your hard disk.
I've a suspicion that to render an image I would have to
I was hoping that there would be an easy way of doing it
March 25, 2003 at 10:26 am
Well, they may do it that way, but to simply spit out an image stored in a database to a client browser (or whatever communicating with your webserver via HTTP) you simply do the following (very much pseudo-code):
Connect to database using ADO
Retrieve data from image column into ADODB.Stream object (check this KB for info on this: http://support.microsoft.com/default.aspx?scid=KB;en-us;q258038)
Set the ASP Response objects type properties to image/gif (or how it's written)
Write the stream to the ASP Response object
Or something like that..
--
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply