title: Store and retrieve images from file system instead of database
body: <p>I need a place to store images. My first thought was to use the database, but <a href="https://stackoverflow.com/questions/766048/store-image-in-database-or-in-a-system-file">many seems to recommend using the filesystem</a>. This seems to fit my case, but how do I implement it?</p>
  
  <p>The filenames need to be unique, how to do that. Should I use a guid?</p>
  
  <p>How to retrieve the files, should I go directly to the database using the filename, make a aspx page and passing either filename or primary key as a querystring and then read the file.</p>
  
  <p>What about client side caching, is that enabled when using a page like image.aspx?id=123 ?</p>
  
  <p>How do I delete the files, when the associated record is deleted?</p>
  
  <p>I guess there are many other things that I still haven't thought about.</p>
  
  <p>Links, samples and guidelines are very welcome!</p>