I have a <input type="file" accept=".png,.jpg" />
element.
with attribute accept.
But it is accepting all the files in the firefox and safari. It is working good in chrome and ie. How can i write code for all the browsers
I have a <input type="file" accept=".png,.jpg" />
element.
with attribute accept.
But it is accepting all the files in the firefox and safari. It is working good in chrome and ie. How can i write code for all the browsers
Try this:
<label>Select file:
<input type="file" name="imagefile" accept="image/jpeg, image/png">
</label>
More info here: http://www.w3.org/wiki/HTML/Elements/input/file
you can use this for all browser
<input type="file" name="pic" accept="image/*">