Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

FileUploadStartEventArgs.UploadUrl Property

Specifies a target URL for the upload request.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public string UploadUrl { get; set; }

#Property Value

Type Description
String

The upload URL.

#Remarks

Handle the FileUploadStart event to control file upload before it is started. Use the event argument’s FileInfo property to get information about the file (its name, type, size, and so on).

The Upload component’s UploadUrl property specifies a path of a server-side controller’s action that processes all the upload requests. Use the event argument’s UploadUrl property to change the controller action based on conditions. The snippet below changes the upload URL for PNG files.

<DxUpload Name="myFile" UploadUrl="https://localhost:10000/api/Upload/UploadFile/" 
          FileUploadStart="@OnFileUploadStart">
</DxUpload>

@code {
    void OnFileUploadStart(FileUploadStartEventArgs e) {
        if (e.FileInfo.Type == "image/png")
            e.UploadUrl = "https://localhost:10000/api/Upload/UploadPng/";
    }
}
See Also