views:

41

answers:

2

Hi,
we have the following scenario:
* a .NET application allows users to upload documents.
* the documents are stored in a filesystem, currently inaccessible to users. the path is basically \year\month\day\filename.ext
* the path and filename are stored in a database (MS SQL200) that is used to link the documents to various records in the system

the question:
how to implement a situation where:
we maintain the link between the files and the records
we allow users to modify the files and to access them easily
we prevent situations where the files and the db would become unsynchronized.
it has to be as user friendly as possible (e.g. no "download the file, modify and upload it again")
Thanks for any hints and pointers to a direction Matej

+7  A: 

Before you reinvent the wheel, have you considered SharePoint?

Andrew Hare
+1 SharePoint is nice and can be extended if needed.
Tamás Szelei
+1  A: 

As Andrew said (+1), you should to consider Sharepoint. That would be my first option.

If you still need to do it from scratch, your filesystem folder will need to have their ACL permissions restricted for a unique user, controlled by your application (maybe your application pool user). This user, and only this, is allowed to manipulate that documents. Or you can consider to store them in your database, just like Sharepoint does.

You'll need to deal with users uploading files with same name in same day.

To download them, you can start by implementing a IHttpAsyncHandler; it's starts trivial, but get complicated very easily.

Rubens Farias