Get the default file extension associated with a MIME type and subtype.
function GetMIMEDefaultFileExt( const MIMEType: string ): string;
Parameters |
Description |
MIMEType |
MIME type and subtype for the association. |
String - Default file extension for the requested MIME type.
GetMIMEDefaultFileExt is a string function used to get the default file extension associated with the MIME type indicated in the MIMEType argument. The value in MIMEType should contain the MIME type and subtype including the MIME seperator, in the form:
type/subtype
Internally, GetMIMEDefaultFileExt uses an instance of the TIdMimeTable class to access the MIME types and associated file extensions registered on the local computer. Comparisions using the value in MIMEType are case-insensitive; all of the following values are considered to be equivalent:
"text/html" |
"TEXT/html" |
"TEXT/HTML" |
The return value for the method contains the initial file extension found for the indicated MIME type and substype, or an empty string ('') when no file extenstion has been associated with the requested MIME type.
Use GetMIMETypeFromFile to determine the registered MIME type for a file with a specified file name and extension.
Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved. Website http://www.indyproject.org. Post feedback to the Indy Documentation newsgroup. |