[Solved] AsyncUpload UploadedFiles Collection sort order

1 Answer 6 Views
AsyncUpload
Fit2Page
Top achievements
Rank 2
Bronze
Iron
Iron
Fit2Page asked on 12 May 2026, 10:01 AM

Hi,

I have to process the files in the UploadedFiles collection in a certain order (alphabetical). Is that possible from the collection (LINQ?) or should I save the files first to the TargetDirectory and go from there?

Marc

1 Answer, 1 is accepted

Sort by
0
Vasko
Telerik team
answered on 12 May 2026, 01:12 PM

Hi Marc,

The UploadedFiles collection in RadAsyncUpload reflects the order in which the user selected or dragged the files, not an alphabetical order. There is no built-in property or method to automatically sort the UploadedFiles collection. You do not need to save the files to the TargetDirectory first. You can process the files in alphabetical order directly from the UploadedFiles collection by sorting them with LINQ in your code-behind:

<telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1" MultipleFileSelection="Automatic" />
<telerik:RadButton runat="server" ID="RadButton1" Text="Postback" AutoPostBack="true" OnClick="RadButton1_Click" />
protected void RadButton1_Click(object sender, EventArgs e)
{
    List<UploadedFile> sortedFiles = RadAsyncUpload1.UploadedFiles.Cast<UploadedFile>()
        .OrderBy(f => f.FileName)
        .ToList();

    foreach (UploadedFile file in sortedFiles)
    {
        // Process each file in alphabetical order
    }
}

    Regards,
    Vasko
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
    Tags
    AsyncUpload
    Asked by
    Fit2Page
    Top achievements
    Rank 2
    Bronze
    Iron
    Iron
    Answers by
    Vasko
    Telerik team
    Share this question
    or