lIP TT lIP TT - 1 year ago 79
HTML Question

HTML accept attribute multiple image types

In my code I have got this input type file:

<input type="file" id="chatsf" accept="image/png,image/jpg">


What I want is this input to only accept PNG and JPG files, but with my code it only accepts PNG files.

Answer Source

I believe the correct string for .jpg files is image/jpeg:

<input type="file" id="chatsf" accept="image/png, image/jpeg" />