|Subject:||Re: Is there any constants for TIdMessagePart.ContentType|
|Posted by:||Remy Lebeau \(Indy Team\) (email@example.com)|
|Date:||Mon, 12 Mar 2007|
"Sherlyn Chew" <sherl…@estream.com.my> wrote in message
> There are some content type for TIdMessagePart. For example
> text/html, image/bmp and etc. Is there any constants declared
> for each content types ?
Not in code, no. Such type have to registered with IANA
http://www.iana.org/assignments/media-types/index.html), and are
stored in the OS's configuration. For Windows, known types are stored
in the Registry (HKCR\MIME\Database\Content Type). For Linux, known
types are stored in configuration files (/etc/mime.types,
> For bitmap image i need to assign "image/bmp" to the content type
> and so on for jpeg and gif, is there any available method to help
> me determine and assign content type for image?
Indy handles all of that automatically. Given just a filename, it
will dynamically look up the appropriate type if you do not specify a
specific type yourself. If you must look it up yourself, then you can
use Indy's GetMIMETypeFromFile() function.
Is there any constants for TIdMessagePart.ContentType posted by Sherlyn Chew on Mon, 12 Mar 2007