2

This seems to work very well for filtering image type for file-uploads

<input type="file" accept="image/*">

Ref Thread : File input 'accept' attribute - is it useful?

and this seems to work only on Chrome :

<input type="file" name="imagefilename" accept="image/x-png, image/gif, image/jpeg" />

Ref thread : How to allow <input type="file"> to accept only image files

Question : I understand there are ways to validate the image extension using jQuery or Server side....but has anyone come across any attribute, which can filter image through pure html5 way, by adding something in input type="file" section, which if not cross-browser, then atleast supports standard browsers like opera,moz,chrome,safari and IE9+????

Please note i am asking for PURE HTML way.....no workarounds or hacks!!

Reason for asking : Referred threads are pretty old and i couldn't find much helpful stuff on google....may be someone knows something...!! :)

Community
  • 1
  • 1
NoobEditor
  • 14,239
  • 13
  • 66
  • 102

1 Answers1

0

According to this http://www.w3schools.com/tags/att_input_accept.asp

The accept attribute of the tag is not supported in Internet Explorer 9 and earlier versions.

So you will have to use jQuery or Server side solution for old IE.

jzhang
  • 1