Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2007
    Location
    Auckland New Zealand
    Posts
    120

    Where to Save Pictures

    Im Using SQL Server 2005, and ASP.NET 2.0, I need to save pictures related too records, should I save them in the database or in the directory (Copy the files and save the filename).

    What are the Drawbacks of saving the Files in the database?

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    This has been covered numerous times before, but for what its worth I store images as paths in the db, rather than store the image itself.

    my reasons
    reduces db bloat
    reduces network overhead, especially if on a web app the images may well be cached somewhere
    reduces backup overhead
    I get round the security issues by being very carefull about who can make changes to the driectory where images are stored
    you are exposed to people changing the image outside the app.. so its possible for the image to be modified and the app doesn't know anything about that.. but you can get round that by also storing file metrics (size, last edit etc) and do a comparison. it could be a problem if say you had an image of the CEO and some 'wag' decided to deface the image.
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    A document control system I'm looking at has a service running on the server, which monitors folder properties where the images are stored; if the folder properties are changed, it changes them right back...
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •