ASPxClientUploadControl.GetSelectedFiles Method

Returns files selected for uploading within the specified file input.


GetSelectedFiles(inputIndex?: number): ASPxClientUploadControlFile[]


Name Type Description
inputIndex number

Specifies a file input's index. Default value is "0".


Type Description

An array of files selected for uploading.


Note that full information about the selected file is available only if the upload control is in advanced mode (ASPxUploadControl.UploadMode is set to "Advanced" or "Auto" for a user's browser that supports HTML5). The control returns null if you use the Microsoft Silverlight plug-in and the browser does not support HTML5.

In standard mode (ASPxUploadControl.UploadMode is set to "Standard"), the returned object provides only the property, while the ASPxClientUploadControlFile.size property is null and the ASPxClientUploadControlFile.sourceFileObject property is -1.


The following example shows how to disable users from uploading files without extension on the client side.

function OnTextChanged() {
    var filesForUploading = uploadControl.GetSelectedFiles();
    if (filesForUploading) {
        var allFilesContainExtension = true;
        for (var i = 0; i < filesForUploading.length; i++) {
            var currentFileName = filesForUploading[i].name;
            if (currentFileName == currentFileName.split('.').pop()) {
                allFilesContainExtension = false;
        if (!allFilesContainExtension) {
            alert("Only files with extentions can be uploaded");
See Also