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

File Upload Restriction

Hi, 

Just wanting to know how it is possible to restrict the file extensions which can be uploaded when using the File Explorer. I know this functionality exists in the UploadBox but can't see any documentation when using the File Explorer.

Many thanks,
Frankie

1 Reply

AB Ashokkumar Balasubramanian Syncfusion Team July 31, 2019 08:50 AM UTC

Hi Frankie,  
 
Greetings from Syncfusion support. 
 
In our FileExplorer component, we have provided the fileTypes property for allows specified type of files only to display. You can use this property to allows the specified type of files in all the file operations. Please check the below help document. 
 
 
We have used the same UploadBox functionality in FileExplorer component, so if you want to restrict the file types in Upload functionality. You can use the FileExplorer create event to access the corresponding UploadBox element and restrict it. Please find the below code block. 
 
function onCreate() { 
            this.element.find(".e-uploadbox").ejUploadbox("instance").option("extensionsAllow", ".css"); 
     
} 
 
Please check the above provided information’s and get back to us, if you require any further assistance. 
 
Regards, 
Ashokkumar B. 


Loader.
Up arrow icon