Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Storing Images / files in the database

Status
Not open for further replies.

Kalisto

Programmer
Feb 18, 2003
997
GB
It seems that this week its all SQL issues.

I would like some help / input as to best practice here.

Ive been asked to scope a new application for handling various documents / orders and so on in one of our warehouses.

The plan is that at each stage where a signature is required to use some kind of electronic sig pad to get a signature from the appropriate person (s) and print this to the documentation.

Being as this data has to be kept for a number of years, and our paperwork seems to have its format changed every few months this gives me a slight problem.

As I see it I have a few options.

1) Keep Each paperwork template as seperate, so that if it changes we can still print out the exact paperwork format that was originally signed. More coding effort required up front to ensure we can handle the templates, but more flexible long term.

2) Keep a single Current template, and when an order is signed, create a pdf of it and save it as a file. (After all, once an order is signed we wont be changing the paperwork, and this makes a relatively immutable copy). However this means I need to decide to store the pdf's either as files, or as blobs in the database.

Bearing in mind if I chose Option 1 I will need to save the signature jpegs somewhere.

So, for best practice am I better off storing this information in a database, or as files ?

(typically you could be looking at 4000 documents a year, and as some need 2 signatures, about 7000 signature images, we need to keep these images for 3 years before they can be archived off. Im nervous with the idea of having to manage some 12000 documents and 21000 image files on my server, but I have this suspicion that this type of data should not be going into the database...)

Thoughts, comments anyone?
 
And you are right of course, the images and documents should be kept out of the DB, but sometimes this is not possible. You can keep just path to them in your DB but that means you (and all of your users) should have a full rights over some network folder where you should store images and every time a user select a document/image you should copy it there and save the path to it in your DB.

If you use SQL Server 2008 that you must check new field type FILESTREAM. That type keeps all files out of the DB, but I never worked with it yet, so I can't gave you an example how to to this.

Borislav Borissov
VFP9 SP2, SQL Server 2000/2005.
 
Plus those files will be small. 12000 will easily fit on a cd.

Simi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top