Display uploaded files using a parameter in SfUploader

Is it possible to display uploaded files using a parameter? In the documentation I found that UploaderFiles 

have Files parameter but it doesn't work.



Attachment: SfUploader_48d339b1.zip

3 Replies 1 reply marked as answer

VJ Vinitha Jeyakumar Syncfusion Team June 16, 2022 11:50 AM UTC

Hi Cristian,


We couldn't upload the files through parameter, but your requirement to upload preloaded files which are in a list, can be achieved by using foreach loop with UploaderUploadedFiles tag. please check the code and sample below,

Code snippet:
<SfUploader >
     <UploaderFiles>
        @foreach(UploaderUploadedFiles data in UploaderFiles)
        {
             <UploaderUploadedFiles Name="@data.Name" [email protected] Type="@data.Type"></UploaderUploadedFiles>
           
        }
       
          </UploaderFiles>
</SfUploader>

@code{
    public List<UploaderUploadedFiles> UploaderFiles { get; set; } = new();

    protected override Task OnInitializedAsync()
    {
        UploaderFiles = new List<UploaderUploadedFiles>() { new UploaderUploadedFiles() { Name = "tata", Size = 100, Type = ".png" } };
        return base.OnInitializedAsync();
    }
}


Regards,
Vinitha

Marked as answer

CP Cristian Plaiu June 17, 2022 11:58 AM UTC

Hi,

Thanks you it works.




UD UdhayaKumar Duraisamy Syncfusion Team June 20, 2022 06:46 AM UTC

Hi Cristian,

We are glad that your requirement has been fulfilled on your end. We are always happy to assist you.


Regards,

Udhaya Kumar D.


Loader.
Up arrow icon