The Hoju Saram

Wednesday, April 18, 2007

In Dev: C# WebDAV Server with SQL Backend



The work I am doing on building a WebDAV Server with SQL Backend is progressing well. I found a .net web dav server framework at sourceforge , which provides much of the plumbing for the WebDAV server. Their implementation is for a server that uses the file system for storage, I want to use an sql database so that DAV properties can be used inside other .net applications.

One of the problems with the filesystem based implementation, is that the properties of each file (including the custom properties) are binary serialised to a file. This means that they are not easily searched and/or retrieved by external system, so I definitely want to move this to a SQL database.

I am now at the stage where I have created the SQL database and have written the data and business layers, to replace the filesystem layer with an SQL Layer. This means that from windows explorer I can now map a web drive to my C# app and it will display data in the SQL database as if it is a WebDAV fileshare. I can copy, move , rename, delete the files and folders, and also open and save to/from the app to windows applications. This all works great. I still have to do a bit of work to get locking, custom properties and some of the MS Office specific stuff happening but it is looking promising.

The screen shot above shows an explorer window of the WebDAV share. All of the files and folders that are visible are in fact records in an sql table.

I have also written a small app called “Web Folder Mapper” to allow me to create WebDAV shortcuts. The source for this is downloaded here. This is very helpful because it allows you to create a shortcut and then you can simply drag files to this shortcut and then will be stored on the WebDAV server. The screen shot of the mapper tool is below, with the corresponding shortcut that was build on my desktop.



I will release the server source code as soon as I get the rest of the implementation working. I will also be sending it to the admin of the sourceforge framework project, as they have asked for code from anyone who uses the framework to create an implementation.

Labels: , ,

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home