Blogs

News

Email Subscriptions

Mehul Harry's DevExpress Blog

ASP.NET File Manager - Data Bind using Data Source (available now in v2011.1)

     

Check out the new feature of our ASP.NET File Manager that allows you to data bind to a database using a DataSource.

Yes, our ASP.NET File Manager control can connect to a database backend and generate the file system user interface. You can use any data source components too like the SQLDataSource!

Here's the markup code with the ASPxFileManager and an XPO Data Source:

<dx:ASPxFileManager 
    ID="fileManager" 
    runat="server" 
    DataSourceID="XpoDataSource1">
    <Settings 
        ThumbnailFolder="~/Content/FileManager/Thumbnails" 
        ThumbnailSize="100" 
        InitialFolder="Salvador Dali\1936 - 1945" />
    <SettingsDataSource 
        KeyFieldName="Id" 
        ParentKeyFieldName="Pid" 
        NameFieldName="Name" 
        IsFolderFieldName="IsFolder" 
        FileBinaryContentFieldName="Data" 
        LastWriteTimeFieldName="LastWriteTime" />
    <SettingsUpload 
        Enabled="false"></SettingsUpload>
</dx:ASPxFileManager>
<dx:XpoDataSource 
    ID="XpoDataSource1" 
    runat="server" 
    TypeName="PersistentObjects.ArtsEntity">
</dx:XpoDataSource>

File System Providers

ASP.NET FileManager - Database BindingThe ASPxFileManager supports any file system:

  • stored on the physical disk
  • net shared disk
  • in a database
  • custom storage

To work with these file systems, we introduced a special API called a 'File System provider'. And the DevExpress ASP.NET File Manager control, the ASPxFileManager, has two predefined file system providers:

  • PhysicalFileSystemProvider
  • DataSourceFileSystemProvider

What is a file system provider? A file system provider is an API for access to the virtual file system in the ASP.NET File Manager control.

This API provides the definition of methods for getting a file and folder hierarchy. We also provide the methods for editing the FileManager's items like creating a folder, renaming files/folders, deleting files/folders, etc. The File Manager control uses the provider for all operations in the file system.

Databinding to DataSource

You can use any datasource component, such as:

  • SQLDataSource
  • XpoDataSource
  • Entity Framework Datasource
  • and more…

Use any datasources for the ASPxFileManager's file system. Configure the SettingsDataSource section’s properties and set the DataSource or DataSourceID property. The DataSourceFileSystemProvider will be created inside ASPxFileManager and the file system stored in the datasource. Here's a screenshot of the properties:

ASP.NET FileManager - Settings DataSource

File Management

The ASPxFileManager's providers give you a definition of methods for getting a file and folder hierarchy. We also provide you methods for editing the FileManager's items. This includes:

  • creating a folder
  • renaming files/folders
  • deleting files/folders
  • moving files/folders
  • file upload

In the next blog post, I'll tell you about the process of customizing the FileManager’s file system provider.

Available now in v2011 volume 1

The new data source file system provider is available now in the DXperience v2011 volume 1 release.

What do you think of the new capability to data bind and give your end-users a powerful file manager control on your websites? Drop me a line below. Thanks!

Follow MehulHarry on Twitter

DXperience? What's That?

DXperience is the .NET developer's secret weapon. Get full access to a complete suite of professional components that let you instantly drop in new features, designer styles and fast performance for your applications. Try a fully-functional version of DXperience for free now: http://www.devexpress.com/Downloads/NET/

Published Mar 04 2011, 01:50 PM by Mehul Harry (DevExpress)
Technorati tags: Features, v2011.1, DXperience, ASP.NET
Bookmark and Share

Comments

 

Phil Holt said:

Until the FM control can do a details view with sorting by columns, rmb's to create new folders, delete, rename, etc - it's just eye candy.

Maybe I missed how to configure the control for that type of view but all I can discover is the icon view.

with the icon view, if you have long filenames they're cut off and there's no way to see them. How can you compare creation dates?

I was excited to see this control from my favorite vendor but it's not quite there yet. I'm not hopeing for an win explorer replacement, but how about the win 3.1 FileManager?

March 5, 2011 12:24 AM
 

Roman Resh (DevExpress) said:

Hi Phil!

For now, ASPxFileManager displays files only using a thumbnail (icon) view. We are planning to extend view capabilities (see Suggestion ID: S36152 - Add the capability to display files using various views (table layout, small/medium/large thumbnails, etc.) (www.devexpress.com/issue=S36152)) In response to your request, I have created a suggestion to add a context menu to ASPxFileManager (see Suggestion ID: S36949 - Add the context menu to folders and files panels (www.devexpress.com/issue=S36949)). Please track these suggestions to be automatically notified once they are implemented.

If you need any specific feature or functionality in ASPxFileManager, please don't hesitate to submit corresponding suggestions to our Support Center. We will judge the number of trackers and implement the most popular suggestions in the nearest releases.

March 5, 2011 5:23 AM
 

Damir Pečnik said:

Will this be available for MVC Controls?

March 5, 2011 7:17 AM
 

Roman Resh (DevExpress) said:

We don't have any requests to provide ASPxFileManager's extension for MVC. I have created a suggestion to implement this functionality: S36974 - Provide ASP.NET MVC extension for ASPxFileManager (www.devexpress.com/issue=S36974). Please track this suggestion to be automatically notified once it is implemented. We will implement most popular suggestions.

March 10, 2011 4:58 AM
 

Marek Zgadzaj said:

What about S36150 - the capability to download a selected file ?

Thanks, Marek.

March 13, 2011 5:49 PM
 

Roman Resh (DevExpress) said:

Hello, Marek.

We have completed this suggestion and will publish it in v11.1.

March 14, 2011 5:09 AM
 

Marek Zgadzaj said:

Hello Roman,

Very good news. Thank you.

March 15, 2011 10:43 AM
 

Ahmed Permassa said:

This feature is good but there is no option for permissions.

August 3, 2011 10:28 AM
 

Mehul Harry (DevExpress) said:

August 12, 2011 3:32 PM

About Mehul Harry (DevExpress)

Mehul Harry is an ASP.NET technical evangelist at Developer Express. You can reach him directly at mharry@DevExpress.com. You can also follow him on Twitter: http://twitter.com/mehulharry
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.