We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Preload files with error

hello,
 I'm using the UploaderComponent component to download the files. However, I would like to preload the files but by default, the files are configured with the state uploaded successfully. my problem is to configure with the state umpled with error and to display a message of error




1 Reply

SP Sureshkumar P Syncfusion Team November 13, 2019 01:52 PM UTC

Hi TOKO, 
 
Greetings from Syncfusion support. 
 
We have validated your requirement. We don’t have inbuild support for changing the preloaded files status message. but we can achieve your requirement with workaround solution using our fileListRendering event.  
 
Kindly refer the below code example. 
 
filelistCreation(args) { 
    if (args.isPreload) { 
        var customMessage = "failed"; 
        var statusElement = args.element.querySelector('.e-file-status'); 
        statusElement.classList.add('e-upload-fails'); 
        statusElement.classList.remove('e-upload-success'); 
        statusElement.innerText = customMessage; 
    } 
} 
 
 
 
We have created a sample based on your requirement. Please find the sample here: https://stackblitz.com/edit/react-jlwbsr-4zdqd5?file=index.js  
 
To know more about our fileListRendering event. Please refer the below documentation link: https://ej2.syncfusion.com/angular/documentation/api/uploader#filelistrendering  
 
  
Regards, 
Sureshkumar P 


Loader.
Live Chat Icon For mobile
Up arrow icon