dimanche 10 mai 2015

How to access validity of accept parameter in html input

I've got a hidden input file field, and I want to restrict the type of files it accepts. I was hoping I could still leverage the accepts attribute, but have been unable to find a way to check that the input fields value is valid.

My field is

<input type="file" name="imgFile" onChange="convertFile()" accept="image/jpeg,image/gif,image/png" />

Aucun commentaire:

Enregistrer un commentaire