Category / Section
How to prevent multiple file upload in the File Manager component
2 mins read
Step 1: Implement File Manager component using our getting started documentation.
Step 2: To achieve prevention of multiple file selection in window explorer during file uploads, You can utilize the help of the React Uploader multiple property in the React File Manager created event. This multiple property specifies the boolean value that indicates whether the multiple files can be browsed or dropped simultaneously.
[index.js]
<FileManagerComponent
ref={(filemanager) => {fileObj = filemanager;}}created={onCreated.bind(this)}
</FileManagerComponent>
const onCreated = (args) => {
fileObj.uploadObj.multiple = false;
}
Sample: https://stackblitz.com/edit/react-rd4brf-ixeqjp?file=index.js