Skip to content

Add "Accept" file input parameter to restrict input file formats #21

@dgrabla

Description

@dgrabla

It would be great if we could restrict the format of the selectable files. At the moment when we click on the component, a native file picker is opened where the user can select any file. If a non-image is selected, the component fails silently. If the file is an image, the canvas is populated and the image converted to the format selected on the imageFormat prop.

It would be great to be able to open a "restricted" file picker with a list of possible format. v-file-input has the accept property, but here it seems we use a different vue-file-upload component.

We would need to create a new prop "accept" on the vuetifyImageInput and then use it on the input form appended onClick on /src/VueFileUpload/methods/onClick.js . Would that work?

On https://github.com/SeregPie/VuetifyImageInput/blob/master/src/VueFileUpload/methods/onClick.js

input.setAttribute('type', 'file');
input.setAttribute('accept', '.png');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions