Inserting Images Into Database

Discussion in 'Databases' started by darryl, Mar 21, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have been tring to come up with a way to Insert my product images into a table in my database I have the table.

    I have the following fields in it

    ProdID,int
    LG_img_name,varchar(50)
    LG_img_data,image
    LG_img_contenttype,varchar(50)
    SM_img_name,varchar(50)
    SM_img_data,image
    SM_img_contenttype,varchar(50)

    The LG fields are for the full size images and the SM fields are for the thumbnail images. These images are on my websever and not the SQL 2008 Sever.

    So anyone know how I can populate my table with these images there is about 2001 full size and 2001 thumnail images
     
  2. Joseph Jun

    Joseph Jun DiscountASP.NET Staff

    Storing binary large objects in a database usually isn't recommended and a better alternative solution would be to leave the images on the web server's file system and store the paths to the images in the database.

    But, if it's an absolute must that you need to retain the images in the database, I'm guessing you're going to be looking at some script-based solution as manually inserting 2,000 records would suck...a lot.

    What scripting technology are you most familiar with and will you be trying the inserts in a development environment or on a hosted account?
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page