title: To Do or Not to Do: Store Images in a Database
body: <p>In the context of a web application, my old boss always said put a reference to an image in the database, not the image itself. I tend to agree that storing an url vs. the image itself in the DB is a good idea, but where I work now, we store a lot of images in the database.</p>
  
  <p>The only reason I can think of is perhaps it's more secure? You don't want someone having a direct link to an url? But if that is the case, you can always have the web site/server handle images, like handlers in asp.net so that a user needs to authenticate to view the image. I'm also thinking performance would be hurt by pulling out the images from the database. Any other reasons why it might be a good/not so good idea to store images in a database? </p>
  
  <hr>
  
  <p><strong>Exact Duplicate:</strong> <a href="https://stackoverflow.com/questions/585224/user-images-database-vs-filesystem-storage">User Images: Database or filesystem storage?</a><br>
  <strong>Exact Duplicate:</strong> <a href="https://stackoverflow.com/questions/3748/storing-images-in-db-yea-or-nay">Storing images in database: Yea or nay?</a><br>
  <strong>Exact Duplicate:</strong> <a href="https://stackoverflow.com/questions/713243/should-i-store-my-images-in-the-database-or-folders">Should I store my images in the database or folders?</a><br>
  <strong>Exact Duplicate:</strong> <a href="https://stackoverflow.com/questions/662488/would-you-store-binary-data-in-database-or-in-file-system">Would you store binary data in database or folders?</a><br>
  <strong>Exact Duplicate:</strong> <a href="https://stackoverflow.com/questions/561447/store-pictures-as-files-or-in-the-database-for-a-web-app">Store pictures as files or or the database for a web app?</a><br>
  <strong>Exact Duplicate:</strong> <a href="https://stackoverflow.com/questions/325126/storing-a-small-number-of-images-blob-or-fs">Storing a small number of images: blob or fs?</a><br>
  <strong>Exact Duplicate:</strong> <a href="https://stackoverflow.com/questions/766048/store-image-in-database-or-in-a-system-file">store image in filesystem or database?</a></p>