Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Add a file extension check on the validator. #187

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add a file extension check on the validator. #187

wants to merge 1 commit into from

Conversation

roipoussiere
Copy link

Considering the input:

<input id="file-button" type="file" accept=".png, .bmp" data-ext="accept">

Then, if you select a file with a wrong extension (it's possible even if you fill the accept attribute), this will display the error: This file type is not supported.

You can also set your valid extensions with: data-ext=".png, .bmp", in this way you don't have to add the accept attribute.

Note: I think than add the data-ext attribute without argument is a more purified syntax, but I'm waiting for #118 .

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

Successfully merging this pull request may close these issues.

1 participant