Has anybody ever thought about the advantages of storing attachments in the database instead of storing them in the filesystem?
Especially when you have a lot of nodes from which nearly each node has an attached file, this - from my point of view - would make sense.
If you have the attached files stored in the filesystem the whole content becomes very complex after uploading all the files into one or more directories.
If you have the attached files stored in the database, you can add a reference count to the attached file. This means, if the node referencing this attachment gets deleted, you can also delete the attachment since the reference count becomes 0.
You can add additional properties to the files stored as BLOB in the specific table, probably some properties which additional important information for each attachment.
Backup is probably easier since all files are stored in the database.
I can't imagine that nobody else has thought about this idea. Probably there are some disadvantages which I have not considered.
Comments
DataBase File Manager
After looking around on drupal.org, I must confess that I've found a module which fulfills my wishes - at least on the first view.
DataBase File Manager (DBFM) is the name of this module.
I should give it a try.
P.R.