Skip to main content

ASPxUploadControl.UploadedFiles Property

Provides access to an array whose entries correspond to the ASPxUploadControl’s file input elements and contain information on the uploaded files, if any.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.1.dll

NuGet Package: DevExpress.Web


public UploadedFile[] UploadedFiles { get; }

Property Value

Type Description

An array of UploadedFile objects associated with file input elements.


In order to upload a file, an end-user should specify it within a file input element. The total amount of available file input elements is controlled via the ASPxUploadControl.FileInputCount property. This amount can also be dynamically changed by end-users on the client, if the ASPxUploadControl.ShowAddRemoveButtons property is enabled. In this case, the ASPxUploadControl.FileInputCount property value is synchronized with actual number of file input elements after the most recent postback to the server.

The UploadedFiles property is used to access an array of automatically generated UploadedFile objects which are associated with file input elements. For each file input element, there is the corresponding UploadedFile entry within the UploadedFiles array. An individual UploadedFile object can be accessed via its index, which corresponds to the associated file input element’s visual index (it is assumed that file input element indexes are zero-based).


We recommend that you use the UploadedFiles property only in the FileUploadComplete and FilesUploadComplete event handlers because this property may contain invalid data outside these events.


This sample demonstrates how files selected within the ASPxUploadControl can be uploaded via either postback or callback, and how the uploaded files can be saved on the server side by using the FilesUploadComplete event.

View Example

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DevExpress.Web.ASPxUploadControl;

public partial class _Default : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e){


    protected void ASPxUploadControl1_FilesUploadComplete(object sender, DevExpress.Web.ASPxUploadControl.FilesUploadCompleteEventArgs e){
        // Intentionally pauses server-side processing to demonstrate the Loading Panel or Progress Panel functionality

        ASPxUploadControl uploadControl = sender as ASPxUploadControl;

        if (uploadControl.UploadedFiles != null && uploadControl.UploadedFiles.Length > 0){
            for (int i = 0; i < uploadControl.UploadedFiles.Length; i++){
                UploadedFile file = uploadControl.UploadedFiles[i];
                if (file.FileName != ""){
                    string fileName = string.Format("{0}{1}", MapPath("~/Images/"), file.FileName);
                    //file.SaveAs(fileName, true);//OnLine Demo Restriction
See Also