RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TSOAPAttachment.ContentType Property

Specifies the MIME type of the attachment data.

Pascal
property ContentType: string;
C++
__property AnsiString ContentType;

Use ContentType to determine the MIME type (format) used for the data in the attachment. 

When receiving an attachment, the ContentType property is automatically set to reflect the value of the content-type header of the part of the multipart form that holds the attachment. You can read this property to determine how to interpret the contents of the file that the CacheFile property indicates. 

When sending an attachment, set ContentType to indicate the MIME type for the data you are sending. This property should not be set until after setting the SourceString property calling the SetSourceFile or SetSourceStream method. That is because calling SetSourceStream or SetSourceFile automatically sets ContentType to 'Application/binary', and setting SourceString automatically sets ContentType to 'Text/simple'. There is no need to reset ContentType if these values are correct. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!