Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Collapse]Business Model Design
    Business Model Design Basics
    Built-in Business Classes for Most Popular Scenarios
   [Expand]Business Model Design with Entity Framework
   [Expand]Business Model Design with XPO
    Non-Persistent Objects
    PropertyChanged Event in Business Classes
   [Collapse]Data Types Supported by built-in Editors
     Key Properties
    [Expand]String Properties
    [Expand]Numeric Properties
    [Expand]Date and Time Properties
    [Expand]Boolean Properties
    [Expand]BLOB Image Properties
    [Expand]Collection Properties
    [Expand]Reference (Foreign Key, Complex Type) Properties
    [Collapse]File Attachment Properties
      File Attachment Properties in XPO
      File Attachment Properties in Entity Framework
      File Attachment Properties in Domain Components
    [Expand]Type Properties
    [Expand]Enumeration Properties
    [Expand]Criteria Properties
    [Expand]Color Properties
     Geolocation Properties
     Miscellaneous Property Types
    Mapping Complex Types to the Database
   [Expand]Types Info Subsystem
    Connect an XAF Application to a Database Provider
    Data Annotations in Data Model
    Create and Update the Application's Database
  [Expand]Application Model
  [Expand]UI Construction
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

File Attachment Properties

In XAF, the File Attachments Module provides the BLOB file attachment functionality.

The image below illustrates IFileData type business class properties.

WinForms

ASP.NET

Mobile

Note

Refer to the Property Editors | File Attachment Properties section in the Feature Center demo installed with XAF to see File Attachment Property Editors in action. By default, the Feature Center demo is installed in %PUBLIC%\Documents\DevExpress Demos 17.1\Components\eXpressApp Framework\FeatureCenter. The ASP.NET version of this demo is available online at http://demos.devexpress.com/XAF/FeatureCenter/.

Expanded Examples

Expanded WinForms Property Editors for File Attachment Properties

Each WinForms Property Editor has a control that displays a corresponding property in a Detail View, and a repository item that displays a property in a List Editor that supports in-place editing. The table below shows both the control and repository item.

FileDataPropertyEditor

Control: FileDataEdit - a ButtonEdit control descendant. The OpenFileDialog is used to attach a file.

Repository Item: RepositoryItemFileDataEdit - a descendant of the XtraEditors Library's RepositoryItemButtonEdit repository item.

Description:

Used for properties of the types that implement the IFileData interface by default. For instance, the FileData type is a built-in type that implements this interface.

This Property Editor is contained in the File Attachments Module. It is used when this module is added to a WinForms application.

The Open, SaveTo and ClearContent Actions, which you can perform with the editor, represent FileAttachmentController Actions. Use the editor's context menu to execute these Actions. Clicking the editor's button or pressing Enter also executes the Open Action.

Expanded ASP.NET Property Editors for File Attachment Properties

Each ASP.NET Property Editor has controls that display a property in a Detail View's View mode and in an Edit mode (see DetailView.ViewEditMode). These controls are listed in the table below.

FileDataPropertyEditor

View mode control: FileDataEdit control which uses the HtmlAnchor control to download the current file in the view mode.

Edit mode control: FileDataEdit control which uses the HtmlAnchor control to download the current file and the ASPxUploadControl to upload a new file in the edit mode. The Change File and Clear buttons are displayed using two ASPxButton controls.

Description:

Used for properties of the types that implement the IFileData interface by default. For instance, the FileData type is a built-in type that implements this interface.

This Property Editor is contained in the File Attachments Module. It is used when this module is added to an ASP.NET application. The FileDataPropertyEditor uses only the FileDataEdit control, which is generated in differently for the view, edit, and read-only modes.

The file representing the property's value is displayed as a link and can be downloaded in the view mode. The Download operation represents the FileAttachmentController's Download Action. In an edit mode, the Edit and Clear operations are added to the download operation.

In the current implementation of the FileDataPropertyEditor, the upload progress is not shown in case the ImmediatePostDataAttribute is applied to the current FileData property or the IModelCommonMemberViewItem.ImmediatePostData option is enabled for the current View Item in Model Editor.

Expanded Mobile Property Editors for File Attachment Properties

Each Mobile Property Editor has widgets that display a property in a Detail View's View mode and in an Edit mode (see DetailView.ViewEditMode). These widgets are listed in the table below.

MobileFileDataPropertyEditor

View mode widget: a widget that displays text that serves as a hyperlink.

View mode widget: a widget that displays text that serves as a hyperlink.

Description:

Used for properties of the types that implement the IFileData interface by default. For instance, the FileData type is a built-in type that implements this interface.

This Property Editor is contained in the File Attachments Module. It is used when this module is added to a Mobile application. The MobileFileDataPropertyEditor uses only the widget, which allows you to download the attached file.

Upload and delete are not available In the MobileFileDataPropertyEditor's current implementation.

How would you rate this topic?​​​​​​​