:SetFileContentType()
Class
Syntax
:SetFileContentType( nType, [cSubType], cFileExt, [hMessage] ) -> lSuccess
Parameters
|
|
nType |
Numeric, See table below. |
|
|
cSubType |
String. Sub-type to assign to the File extension cFileExt. May be left blank to delete a previously defined Content Type. |
|
|
cFileExt |
File Extension to define a Content Type for. |
|
|
hMessage |
Optional. Handle of the message to act on. Provided during :CreateMessage() operation |
Return
Logical indicating Success.
Returns .T. if the operation succeeds, otherwise returns .F.
To get more information about the error, see :nErr and :cErr.
Description
The :SetFileContentType() method associates a per-message content type with a given file name extension.
This association is specific to the message, and is not shared by any other messages that may be opened by the process.
The :SetFileContentType() method allows an application to specify a content type for a given file extension, and is typically used to define custom content types for file attachments. The content type will override any default content types associated with the extension, as well as allow new content types to be defined for application-specific files.
Valid values fot the parameter nType:
|
MIME_CONTENT_UNKNOWN |
The default content type for the specified extension should be used. This value should only be used to delete a previously defined content type. |
|
MIME_CONTENT_APPLICATION |
The file content is application specific. Examples of this type of file would be a Microsoft Word document or an executable program. This is also the default type for files which have an unrecognized file name extension and contain binary data. |
|
MIME_CONTENT_AUDIO |
The file is an audio file in one of several standard formats. Examples of this type of file would be a Windows (.wav) file or MPEG3 (.mp3) file. |
|
MIME_CONTENT_IMAGE |
The file is an image file in one of several standard formats. Examples of this type of file would be a GIF or JPEG image file. |
|
MIME_CONTENT_TEXT |
The file is a text file. This is also the default type for files which have an unrecognized file name extension and contain only printable text data. |
|
MIME_CONTENT_VIDEO |
The file is a video file in one of several standard formats. Examples of this type of file would be a Windows (.avi) or Quicktime (.mov) video file. |
See Also
:AttachFileEx(), :GetFileContentType()