storing ntfs file metadata for retrieval via webserver and linking with database

65 views Asked by At

I am looking for a few pointers to reaching am adequate solution to a problem/feature I need to implement/rectify in my asp.net mvc application.

My application is a LAN only interface that is run over a webserver. In this application there is a page that displays a bunch of files/folders.

I need to be able to store a set of attributes\properties about these files, and those props\attrs need to be independent of their location on the fileserver. This is my main issue, as I could easily link them to the db with the path as the primary key, but alas then as soon as the file moves their link to the db would be lost.

The types of files that need to be displayed unfortunately could be anything. .txt, .exe, media etc etc. So that provides a limiting option also from using something like the tagsharp lib.

One approach i was considering was simply storing a key somehow in the file itself, or with an ADS ( i have no experience in doing this, but am presently trying to research its potentiality).

Does anybody have any experience with this issue, and can recommend a simple approach. I am hoping i do not need to implement an ADS approach as what ive been reading so far is a little bit over my head and im not sure C# will handle the streams adequately for my needs.

2

There are 2 answers

0
Stefan Steinegger On

Opinion based. Proposal anyway: what about an additional file which is found by a naming convention?

MyDocument.doxc
MyDomument.docx.properties
MyMovie.mp4
MyMovie.mp4.properties

When moving / renaming files, make sure you move / rename the properties file the same.

0
xxdefaultxx On

First of all thanks for taking a moment to reply.

I had considered the possibility of using a separate file. The problem is that the users of the filesystem ( which may or may not include users of the lan application ) need to be able to move/copy files independent of db application.

Therefore if a user moves a file in windows explorer, I need it to automatically move those additional properties with it. Unfortunately I cant rely on users to move those additional files on their own volition, and I cant ask users to only use the application to move files ( if i were to generate code for the program to do this ).