Skip to main content
Tab

FileManagerSettings.AllowedFileExtensions Property

Gets or sets the file extensions allowed for display in the ASPxFileManager.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v22.1.dll

Declaration

public virtual string[] AllowedFileExtensions { get; set; }

Property Value

Type Description
String[]

An array of String values that contains the file extensions allowed.

Property Paths

You can access this nested property as listed below:

Show 21 property paths
Library Object Type Path to AllowedFileExtensions
ASP.NET Bootstrap Controls BootstrapFileManager
.Settings.AllowedFileExtensions
ASP.NET Web Forms Controls ASPxFileManager
.Settings.AllowedFileExtensions
HtmlEditorAudioSelectorSettings
.CommonSettings.AllowedFileExtensions
HtmlEditorDocumentSelectorSettings
.CommonSettings.AllowedFileExtensions
HtmlEditorFileManager
.Settings.AllowedFileExtensions
HtmlEditorFileManagerSettingsBase
.CommonSettings.AllowedFileExtensions
HtmlEditorFlashSelectorSettings
.CommonSettings.AllowedFileExtensions
HtmlEditorImageSelectorSettings
.CommonSettings.AllowedFileExtensions
HtmlEditorSelectorSettings
.CommonSettings.AllowedFileExtensions
HtmlEditorVideoSelectorSettings
.CommonSettings.AllowedFileExtensions
RichEditDocumentSelectorSettings
.CommonSettings.AllowedFileExtensions
RichEditFileManager
.Settings.AllowedFileExtensions
RichEditFolderManager
.Settings.AllowedFileExtensions
SpreadsheetDocumentSelectorSettings
.CommonSettings.AllowedFileExtensions
ASP.NET MVC Extensions FileManagerSettings
.Settings.AllowedFileExtensions
MVCxFileManager
.Settings.AllowedFileExtensions
MVCxHtmlEditorAudioSelectorSettings
.CommonSettings.AllowedFileExtensions
MVCxHtmlEditorDocumentSelectorSettings
.CommonSettings.AllowedFileExtensions
MVCxHtmlEditorFlashSelectorSettings
.CommonSettings.AllowedFileExtensions
MVCxHtmlEditorImageSelectorSettings
.CommonSettings.AllowedFileExtensions
MVCxHtmlEditorVideoSelectorSettings
.CommonSettings.AllowedFileExtensions

Remarks

The AllowedFileExtensions property specifies which file extensions can be displayed in the file manager (ASPxFileManager). An array of extensions are standard file extensions which begin with a dot symbol.

Note

Use this property to specified allowed file extensions for upload.

Example

Web Forms (in markup):

<dx:ASPxFileManager ID="fileManager" runat="server" ...>
    <Settings RootFolder="~/Content/FileManager/Files" ThumbnailFolder="~/Content/FileManager/Thumbnails" 
    AllowedFileExtensions=".jpg, .jpeg, .gif, .png" InitialFolder="~/Content/FileManager/Images"/>
    ...
</dx:ASPxFileManager>

Web Forms (in code):

ASPxFileManager fm = new ASPxFileManager();
fm.ID = "ASPxFileManager1";
fm.SettingsUpload.ValidationSettings.DisableHttpHandlerValidation = true;
Page.Form.Controls.Add(fm);
...
fm.Settings.RootFolder = Url.Content("~/Content/FileManager/Files");
fm.Settings.ThumbnailFolder = Url.Content("~/Content/FileManager/Thumbnails");
fm.Settings.InitialFolder = Url.Content("~/Content/FileManager/Images");
fm.Settings.AllowedFileExtensions=new String[] { ".jpeg", ".jpg", ".gif", ".png" };

MVC:

@Html.DevExpress().FileManager( settings => {
    settings.Name = "fileManager";

    settings.Settings.ThumbnailFolder = Url.Content("~/Content/FileManager/Thumbnails");
    settings.Settings.RootFolder = Url.Content("~/Content/FileManager/Files");
    settings.Settings.InitialFolder = "~/Content/FileManager/Images";
    settings.Settings.AllowedFileExtensions= new String[] { ".jpeg", ".jpg", ".gif", ".png" };
    ...
}).BindToFolder(Model).GetHtml()

Online Demo

See Also