Back to Devexpress

DxUpload.ShowFileList Property

blazor-devexpress-dot-blazor-dot-dxupload-ff260705.md

latest1.9 KB
Original Source

DxUpload.ShowFileList Property

Specifies whether to show the file list.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(true)]
[Parameter]
public bool ShowFileList { get; set; }

Property Value

TypeDefaultDescription
Booleantrue

true, to show the file list; otherwise, false.

|

Remarks

Once a user selected a file, the Upload packs the file into an Ajax request and sends this request to the server. The Upload displays this file in the list and indicates the upload status.

Set the ShowFileList property to false to hide the file list.

razor
<DxUpload Name="myFile" UploadUrl="https://localhost:10000/api/Upload/Upload/"
          ShowFileList="false">
</DxUpload>
csharp
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BlazorDemo.AspNetCoreHost;
[Route("api/[controller]")]
[ApiController]
public class UploadController : ControllerBase {
    [HttpPost("[action]")]
    public ActionResult Upload(IFormFile myFile) {
        try {
            // Write code that saves the 'myFile' file.
            // Don't rely on or trust the FileName property without validation.
        } catch {
            return BadRequest();
        }
        return Ok();
    }
}

See Also

DxUpload Class

DxUpload Members

DevExpress.Blazor Namespace