Welcome, Guest
  • Author Topic: Displaying images from MS Sql Server  (Read 2665 times)

    breezewood15

    • Server what's that
    • *
    • Posts: 1
      • View Profile
      • CCNA2
      • Email
    Displaying images from MS Sql Server
    « on: 02/08/11, 05:22 »
    Hi,

    I'm looking into creating a web gallery for an arts store. The pictures will be saved in a MS Sql Server. For now Im just wondering; is this possible?

    BR,
    breezewood

    Jorge Solis

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 14616
      • View Profile
    Re: Displaying images from MS Sql Server
    « Reply #1 on: 02/08/11, 05:36 »
    Usually is a bad idea to save binary files to a database, because you should serialize/unserialize your data each time. Instead, the best approach is to store the filename (and perhaps the path based on your needs) and then use the filename to load the real resource from the filesystem

    Jorge

    Ronald Wernecke

    • Global Moderator
    • Systems Administrator
    • *****
    • Posts: 6203
      • View Profile
      • Professional Support
      • Email
    Re: Displaying images from MS Sql Server
    « Reply #2 on: 02/08/11, 05:43 »
    If these pictures do not need special protection, it is better to save them in the file system, ond only keep a record of the filename and path in the database.

    Otherwise you have to read the binary data from the databese and serialize it to the output.

    This can be done via the graphic labrary of php.

    After you are talking of MS-SQL, you propably have a IIS running.
    If you dont have PHP, you have to find a similar functon in ASP.NET

    As you can see - the easyest methode is the link relation in the database, while the image is stored in the file system.
    happy flashing
    8)
    Ronald