Updated Dbfile project on CodePlex

by Jason Haley 2. June 2009 23:50

Tonight I moved out my latest changes to the DBFile CodePlex site.  The new code fixes some bugs and adds 2 new providers: AzureBlobProvider and WcfFileProvider – which gets the provider count up to 4 (the other 2 are SqlServerProvider and FileSystemProvider).

The AzureBlobProvider requires you to signup to get an Azure account so you can get the account name and shared key to put in the config file.

The WCF provider (and service) are still in progress but the code that I checked in tonight works prototype purposes – not production ready (all the settings are in the config files so you can configure as you need).

This means I can know write code that looks like this (code below uses an extension method on the HttpRequest):

protected void UploadFileClick(object sender, EventArgs e)
{
    if (IsPostBack)
    {
        Request.SaveFilesToDB();
        RefreshList();
    }
}

Which could out of the box (after configuration of course) do any of the following:

  1. Save the file to a Sql Server 2000, 2005 or 2008 database (using static sql or stored procedures)
  2. Send the file to the Azure blob storage
  3. Send the file to another machine using WCF where on the other machine it may save to a SqlServer or FileSystem or Azure blob storage or on to another machine

Here is a listing of the methods on the DBFile class:

image

Once configured, all you need to do is change the defualtProvider value in the config to change which of the providers are used.

image

Next on the list of things to do:

  • Make existing providers easier to setup (ie. creating db tables, sprocs, figure out pros and cons of different WCF settings, etc.)
  • Extend the SqlServerProvider to optionally use the SQL Server 2008 FileStreams
  • Finish the FtpProvider I started last month
  • Add more test coverage … or should I say add some test coverage
  • Add more useful functionality (like async http handlers)

I think 5 will be a good number of providers to stick with until I feel good enough about the code to call it version 1.

Comments (0) | Post RSSRSS comment feed |

Categories:
Tags:

Comments are closed