Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
dgrabla opened this issue Apr 8, 2020 · 1 comment
Open
Milestone

Comments

@dgrabla
Copy link

dgrabla commented Apr 8, 2020

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');
@SeregPie SeregPie added this to the v20.0.0 milestone Jun 18, 2020
@Daniel4Digital
Copy link

Looking for the same feature. Couldn't find a way to add input.setAttribute('accept', 'image/*'); Since the input is only created after choosing the image :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants