faqts : Computers : Programming : Languages : Asp : ASP/VBScript : Database Backed Sites : Microsoft SQL Server

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

489 of 678 people (72%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

How Do I Store Images in the Sql Server Database.What is the datatype to be used and how the image should be inserted into the database?
I know it's never a good idea, but how can I store an image in an SQL database? Please don't tell me

Sep 12th, 2001 03:45
bukko, greg clark, Selvamuthukumaran L,


It's best not to store images in the database, rather, store only a 
reference to the image in the database, ie, a text field 
containing "c:\wwwroot\images\userphotos\user1\user1.jpg"

If you are having people upload files to your site, you can use asp's 
filesystemobject to dynamically create such a file structure.

-- This is true, but in some cases it is necessary, such as for report 
writers which can only extract data from the database. I have done this 
once, but since forgotten how. When I try it now I get invalid data in 
the database. Anybody able to help?



© 1999-2004 Synop Pty Ltd