How to disable the status text of file uploader?

Don't need to show the staus text like "Ready to upload"/ "File uploaded sucessfully" from the uploader control as auto upload is disabled.

How to clear the selected files from code, (without using delete button )along with uploader control

1 Reply 1 reply marked as answer

SN Sevvandhi Nagulan Syncfusion Team December 2, 2020 01:08 PM UTC

Hi Richy, 



Greetings from Syncfusion support. 


Query 1: Don't need to show the staus text like "Ready to upload"/ "File uploaded sucessfully" from the uploader control as auto upload is disabled. 


We checked the reported requirement. You can hide the status message by using below css code. 


<style>  
    .e-upload .e-upload-files .e-upload-file-list .e-file-container .e-file-status {  
        displaynone  
    }  
</style>  



Query 2: How to clear the selected files from code, (without using delete button) along with uploader control 


You can clear the selected files programmatically using public remove method. Refer the below code, 


    public void ClearFiles() 
    { 
        UploadObj.Remove(); 
    } 


If you want to clear the individual files, you can store the files data in change event and pass the files data to the remove method. Refer to the below code, 


public void IndividualClear() 
    { 
        UploadObj.Remove(files[0]); 
    } 
    private void OnChangeUpload(UploadChangeEventArgs args) 
    { 
        foreach (var file in args.Files) 
        { 
            files.Add(new Syncfusion.Blazor.Inputs.FileInfo() 
            { 
                Name = file.FileInfo.Name, 
                Id = file.FileInfo.Id, 
                RawFile = file.FileInfo.RawFile, 
                Size = file.FileInfo.Size, 
                Status = file.FileInfo.Status, 
                StatusCode = file.FileInfo.StatusCode, 
                FileSource = file.FileInfo.FileSource, 
                Input = file.FileInfo.Input, 
                List = file.FileInfo.List, 
                Type = file.FileInfo.Type, 
                ValidationMessages = file.FileInfo.ValidationMessages 
            }); 
            var path = @"path" + file.FileInfo.Name; 
            FileStream filestream = new FileStream(path, FileMode.Create, FileAccess.Write); 
            file.Stream.WriteTo(filestream); 
            filestream.Close(); 
            file.Stream.Close(); 
        } 
    } 


Please find the sample below, 




Please check the above sample and get back to us if you need further assistance. 


Regards, 
Sevvandhi N 


Marked as answer
Loader.
Up arrow icon