[thelist] SQLServer and images

Maximillian Schwanekamp anaxamaxan at neptunewebworks.com
Wed May 12 21:34:48 CDT 2004


----------------------
What I now want to do is store the image *itself* in the database in binary
format. Is this possible, and if so how would I go about it?
----------------------

Don't know your hosting situation, but if you're on a shared host there is a
good chance your hosting package includes SA FileUp[1], which has a
SaveAsBlob method, and SA FileManager which has ImportFromBlob and
ExportToBlob methods (FileManager is usually installed as part of the FileUp
package).  The coding required is very simple - probably a bit simpler than
the MS page Ken S gave a link to.

I would not recommend storing images in the DB only if you'll be serving
them with any frequency at all - retrieving and serving them can be quite
slow.  Also, even smaller images can add a lot of bloat your DB - you might
consider using a separate DB for just the images.  If you're dead set on the
idea, you might use SQL as a repository for all files, and keep local copies
of high-traffic files, or something along those lines.

[1] http://softwareartisans.com/


Maximillian Von Schwanekamp
Dynamic Websites and E-Commerce
www.NeptuneWebworks.com
voice: 541-302-1438
fax: 208-730-6504




More information about the thelist mailing list