Languages
[Edit]
EN

HTML - file input only for doc and docx

0 points
Created by:
user4838
698

In this article, we would like to show you how to create file input only for document files in HTML.

Quick solution:

 

Practical example

Edit

In this example, we create file input using type="file" attribute. To make it allow only documents, we set accept attribute to the types that file input should accept.

 

References

Edit
  1. <input type="file"> - HTML | MDN
  2. Common MIME types - HTTP | MDN

Alternative titles

  1. HTML - file input only for document files
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join