Skip to content

The file component accept file patterns that do not work #6286

@pboucher1960

Description

@pboucher1960

Describe the bug
The File component accept pattern like "*.ext". This pattern is standard, but it's not supported by the ng-file-upload component according to its documentation. When used, this pattern does not filter out files with the specified extension, but it generate an error when selecting a file with a different extension at run time.

Version/Branch
Renderer 5.0.0

To Reproduce
Steps to reproduce the behavior:

  1. Create a new form.
  2. Add a File component.
  3. Select the "File" tab, add "*.jpeg" in the "File Pattern" field and save the component.

Current behavior
In the rendering section of the form, when we click on "Browse Files", the list of files is not limited to jpeg files. The file browser allow the selection of any file, but it generate an error if the wrong file type is selected.

Expected behavior
Since patterns should be somthing like ".jpg,video/,!.zip", a pettern like ".jpg" should not be allowed in the pattern field of the file component ans we should see an error at design time.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions