Skip to main content
Tab

UploadControlValidationSettings.AllowedFileExtensions Property

Gets or sets the allowed file extensions of the uploaded file.

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 allowed file extensions.

Property Paths

You can access this nested property as listed below:

Show 33 property paths
Library Object Type Path to AllowedFileExtensions
ASP.NET Bootstrap Controls BootstrapBinaryImageUploadSettings
.UploadValidationSettings.AllowedFileExtensions
BootstrapFileManagerSettingsUpload
.ValidationSettings.AllowedFileExtensions
BootstrapUploadControl
.ValidationSettings.AllowedFileExtensions
ASP.NET Web Forms Controls ASPxHtmlEditorAudioUploadSettings
.ValidationSettings.AllowedFileExtensions
ASPxHtmlEditorFlashUploadSettings
.ValidationSettings.AllowedFileExtensions
ASPxHtmlEditorImageUploadSettings
.ValidationSettings.AllowedFileExtensions
ASPxHtmlEditorUploadControl
.ValidationSettings.AllowedFileExtensions
ASPxHtmlEditorVideoUploadSettings
.ValidationSettings.AllowedFileExtensions
HtmlEditorAudioSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
HtmlEditorDocumentSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
HtmlEditorFileManagerUploadSettings
.ValidationSettings.AllowedFileExtensions
HtmlEditorFlashSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
HtmlEditorImageSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
HtmlEditorVideoSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
RichEditDocumentSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
SpreadsheetFileManagerUploadSettings
.ValidationSettings.AllowedFileExtensions
ASPxUploadControl
.ValidationSettings.AllowedFileExtensions
BinaryImageUploadSettings
.UploadValidationSettings.AllowedFileExtensions
FileManagerSettingsUpload
.ValidationSettings.AllowedFileExtensions
ASP.NET MVC Extensions UploadControlBinderSettings
.ValidationSettings.AllowedFileExtensions
MVCxFileManagerSettingsUpload
.ValidationSettings.AllowedFileExtensions
MVCxHtmlEditorAudioSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
MVCxHtmlEditorAudioUploadSettings
.ValidationSettings.AllowedFileExtensions
MVCxHtmlEditorDocumentSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
MVCxHtmlEditorFileManagerUploadSettings
.ValidationSettings.AllowedFileExtensions
MVCxHtmlEditorFlashSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
MVCxHtmlEditorFlashUploadSettings
.ValidationSettings.AllowedFileExtensions
MVCxHtmlEditorImageSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
MVCxHtmlEditorImageUploadSettings
.ValidationSettings.AllowedFileExtensions
MVCxHtmlEditorVideoSelectorUploadSettings
.ValidationSettings.AllowedFileExtensions
MVCxHtmlEditorVideoUploadSettings
.ValidationSettings.AllowedFileExtensions
MVCxUploadControl
.ValidationSettings.AllowedFileExtensions
UploadControlSettings
.ValidationSettings.AllowedFileExtensions

Remarks

Use the AllowedFileExtensions property to specify which file extensions are allowed for uploading. If the uploaded file’s extension is not allowed (it’s not listed by the AllowedFileExtensions property), the ASPxUploadControl‘s validation fails and the UploadControlValidationSettings.NotAllowedFileExtensionErrorText property’s value is displayed within the control’s specific error frame or alert box when the upload control operates in Standard or Advanced upload modes, respectively.

ASPxUploadControl-AllowedFileExtensionsError

If the ASPxUploadControl validation fails, the FileUploadCompleteEventArgs.IsValid, ASPxUploadControl.IsValid and ASPxClientUploadControlFileUploadCompleteEventArgs.isValid properties are set to false.

Note that the AllowedFileExtensions property is used only for validating the uploaded file extension. The AllowedFileExtensions property doesn’t allow you to customize the appearance of the File Extension filter in the Open File dialog window. The displayed list of file extensions within the File Extension filter depends on a browser and is controlled by it.

ASPxUploadControl-FileExtensionFilter

Members of an array provided by the AllowedFileExtensions property are standard file extensions which begin with a dot symbol (c# code) and are separated using commas (aspx code).

<dx:ASPxUploadControl runat="server">
    <ValidationSettings AllowedFileExtensions=".jpg,.jpeg,.gif,.png" />
</dx:ASPxUploadControl>
See Also