Skip to content

Upload make configurable check for accepted files #7501

Open
@Manfred-on-github

Description

@Manfred-on-github

Describe your motivation

vaadin upload component has a property "accept", where you can specify what files to accept, e.g. '*.pdf'.
This has two effects:
(1) a filter *.pdf is added to the file-select dialog which the browser opens. This helps users to select the correct file type.
(2) a check is enabled in the component's javascript code that accepts only correct file types. This functionality was added only with some recent version (23 or 24).

While this is good in general, we would like to have an option to disable (2) - or more flexible to be able to supply the checking code.

Reason is: at least on Windows, both in Firefox and Chrome, even when one specifies *.pdf, the browser always adds the option*.*which user can select. It is ok for our application that user can pass any file, still we want this 'accept' feature as initial filter for user.

Describe the solution you'd like

we would like to have an option to disable the file name check in vaadin code (around vaadin-upload-mixin __acceptRegexp) - or (more flexible) to be able to supply the checking code.

Describe alternatives you've considered

of course we could leave empty the property "accept", but then the user will have no hint on what might be the "preferred" content they can upload here.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions