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

Add a file extension check on the validator.#187

Open
lypwig wants to merge 1 commit into1000hz:masterfrom
lypwig:file-ext-check
Open

Add a file extension check on the validator.#187
lypwig wants to merge 1 commit into1000hz:masterfrom
lypwig:file-ext-check

Conversation

@lypwig
Copy link

@lypwig lypwig commented Aug 27, 2015

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