Asked • 05/02/19

File input 'accept' attribute - is it useful?

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 `<input type="file" ...>` tag.Is this attribute useful as a way of limiting file uploads to images, etc? What is the best way to use it?Alternatively, is there a way to limit file types, preferably in the file dialog, for an html file input tag?

1 Expert Answer

By:

Gabriel F. answered • 10/30/19

Tutor
5.0 (85)

Full Stack Software Developer and Mentor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.