How to get the appropriate file extension if the mimeType file type is known

When encoding in java, How to get the corresponding file extension if the file mimeType file is known?

+3
source share
2 answers

There is no official list of file extensions for mime type mappings. Each web server seems to keep its own list. For example, Apache Tomcat has all the mappings defined in xml in the file $CATALINA_HOME/conf/web.xml. You could borrow data from this list that is reliable enough and create Mapfor use in your own code.

+5
source

mime .

+1

Source: https://habr.com/ru/post/1722652/


All Articles