I have faced this problem twice and each time I elected to put them in the
file system and then have some table that tracks filenames and associates to
an object in the database. Obviously you lose referential integrity but it
is possible to write a little program that checks that a row in the table
exists for each file name and a filename exists for each row in the table.
On one project we have 12GB of files and the database is only 500meg in
size. The management of the DB would have been more difficult if all of the
files were stored in it.
If you have a lot of files it is important to choose a good naming scheme
and directory structure. Our scripts automatically create a directory per
year per month per day of month. ie Files\2005\04\3 1\ In that way no one
directory becomes too large.
Backing up the data is also a breaze - xcopy.
You have to structure the transaction during the upload. If you start a
transaction, wait for the file to upload, add it to the database, add it to
the file system and then commit the transaction then you will have some long
running locks. Be careful that if the file does not upload correctly then
everything is clean up as expected.
There is some more code to write to manage the files and directories and the
database but it is a solution that works well.
I hope this helps. Feel free to contact me if you want more information (or
even code)
Dave A
"IkBenHet" <ik********@hot mail.com> wrote in message
news:11******** *************@g 49g2000cwa.goog legroups.com...
Hello,
I am working on an ASP.NET based website project. Without going into
much detail; One of the function on this website will be the
possibility to upload images via a ASP.NET form to the webserver. These
images can then be shown on to webpages throughout the site.
What would be the best way of storing these images? Just by saving them
in a folder on de webserver or in a database?
What are the advantages and disadvantages of both working methods?
Thanks.