Search code examples
delphimime-typesfile-extensiondelphi-xe7

How do I get the standard file extension given a MIME type in Delphi?


Is there a built-in way to get the standard extension of a given MIME type in Delphi (XE7)?

I'm looking for the easiest and most general way to implement a function that would be called like this:

fileExt := GetExtension('text/xml');

Solution

  • HKEY_CLASSES_ROOT\MIME\Database\Content Type\text/html, value Extension.