<p>Implementing a file upload under html is fairly simple, but I just noticed that there is an 'accept' attribute that can be added to the <code>&lt;input type="file" ...&gt;</code> tag.</p>

<p>Is this attribute useful as a way of limiting file uploads to images, etc? What is the best way to use it?</p>

<p>Alternatively, is there a way to limit file types, preferably in the file dialog, for an html file input tag?</p>

Accept attribute was introduced in the
RFC 1867
, intending to enable file-type filtering based on MIME type for the file-select control. But as of 2008, most, if not all, browsers make no use of this attribute. Using client-side scripting, you can make a sort of extension based validation, for submit data of correct type (extension).
Other solutions for advanced file uploading require Flash movies like
SWFUpload
or Java Applets like
JUpload
.