Topic: MdbFileUpload - allow only specific file types

Revature Pro priority asked 4 years ago


  1. How to restrict the user to upload only specific file types? [Example: only images]
  2. How to handle max file size?
  3. Any sample code for customText: ITextTranslation
  4. this.uploader.reset() -> not resetting the file
  5. When default file is given, When u hover on tooltip No file chosen is displayed Reference: No File Chosen

Revature Pro priority answered 4 years ago


We are using v8.0.0 for mdb-file-upload and ng-uikit-pro-standard v8.0.0


Arkadiusz Idzikowski staff answered 4 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'.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Opened

Specification of the issue

  • 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