If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Where to Save Pictures

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-04-07, 02:21
Nate1 Nate1 is offline
Registered User
 
Join Date: Aug 2007
Location: Auckland New Zealand
Posts: 113
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?
Reply With Quote
  #2 (permalink)  
Old 09-04-07, 03:54
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 09-04-07, 18:53
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
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

Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On