Topic: How to restrict the input type file (mdbFileSelect) to only one file ?
Good morning,
How can I use the mdbFileSelect to allow only one file upload at a time ?
Also, how can i reset this input type file ?
Thank you
Arkadiusz Idzikowski staff answered 6 years ago
To limit file number please add this options to your code:
options: UploaderOptions
constructor() {
this.options = { maxUploads: 1 };
}
You can add 'this.files = []' to your 'startUpload()' function to reset the input after uploading files.
herve pro answered 6 years ago
Thank you very much
Is there a documentation where i could find all others options that I can modify ?
Thank you
Arkadiusz Idzikowski staff answered 6 years ago
We will update the documentation. Here are examples of options that you can use with file input component:
- concurrency: number - number of files that are uploaded at the same time
- allowedContentTypes?: string[] - allow to specify allowed file formats
- maxUploads?: number - max number of files that can be uploaded
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- User: Pro
- Premium support: No
- Technology: MDB Angular
- MDB Version: 7.0.0
- Device: pc
- Browser: chrome
- OS: w7
- Provided sample code: No
- Provided link: No