How can I validate that only .png file should upload and valid for logo

Hello!
I want to upload only .png file for logo, so how can I validate that only .png file should upload and valid for logo

1 Reply 1 reply marked as answer

SP Sureshkumar P Syncfusion Team June 17, 2020 09:04 AM UTC

HI Ishan, 
 
Greetings from Syncfusion support. 
 
Yes, we can validate the uploaded file based on file type. We suggest using the AllowedExtensions property to achieve your requirement.  
 
Please find the code example here:  
@Html.EJS().Uploader("UploadFiles").AllowedExtensions(".png").AutoUpload(false).AsyncSettings(new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = "https://ej2.syncfusion.com/services/api/uploadbox/Save", RemoveUrl = "https://ej2.syncfusion.com/services/api/uploadbox/Remove" }).Render() 
 
 
To know more about file validation based on type. Please refer the documentation link: https://ej2.syncfusion.com/aspnetmvc/documentation/uploader/validation/#file-type  
 
Regards, 
Sureshkumar P 
 


Marked as answer
Loader.
Up arrow icon