How to bring coordination between file system and database?
- by Lock up
I am working on a online file management project. We are storing references on the database (sql server) and files data on the on file system.
We are facing a problem of coordination between file system and database while we are uploading a file and also in case of deleting a file. First we create a reference in the database or store files on file system.
The problem is that if I create a reference in the database first and then store a file on file system, but while storing files on the file system any type of error occur, then the reference for that file is created in the database but no file data exist on the file system.
Please give me some solution how to deal with such situation. I am badly in need of it.
This case happens also while we deleting a file?