Store and retrieve images from file system instead of database
Posted
by Karsten
on Stack Overflow
See other posts from Stack Overflow
or by Karsten
Published on 2010-03-17T11:07:53Z
Indexed on
2010/03/17
11:11 UTC
Read the original article
Hit count: 632
Hi
I need a place to store images. My first thought was to use the database, but many seems to recommend using the filesystem. This seems to fit my case, but how do I implement it?
The filenames need to be unique, how to do that. Should I use a guid?
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.
What about client side caching, is that enabled when using a page like image.aspx?id=123 ?
How do I delete the files, when the associated record is deleted?
I guess there are many other things that I still haven't thought about.
Links, samples and guidelines are very welcome!
© Stack Overflow or respective owner