Topic: MdbFileUpload - allow only specific file types
Revature Pro priority asked 5 years ago
- How to restrict the user to upload only specific file types? [Example: only images]
- How to handle max file size?
- Any sample code for
customText: ITextTranslation
- this.uploader.reset() -> not resetting the file
- When default file is given, When u hover on tooltip No file chosen is displayed Reference:
Arkadiusz Idzikowski staff answered 5 years ago
Currently there are no built-in methods that would help to restrict file type and size. However, you can listen to (fileAdded)
output, which returns all necessary information that you can then use to block specific files from uploading.
customText
is an object with 3 parameters that allow to add new translations for file upload component:
{fileText: 'Drag and drop a file here or click', removeText: 'Remove', imageFileText: 'Drag and drop or click to replace'}
I couldn't reproduce the problem with reset()
method on my end. Which version of the plugin do you use? Please try to use FileUploadComponent
, there was no 'Mdb' prefix in older versions.
We will take a closer look at the problem with 'No file choosen'.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Opened
- ForumUser: Priority
- Premium support: Yes
- Technology: MDB Angular
- MDB Version: 8.0.0
- Device: all
- Browser: all
- OS: all
- Provided sample code: Yes
- Provided link: No