Class Attachment
Represents a file attachment with its content, name, MIME type, and size.
Supported Image Formats: PNG, BMP, GIF, PSD, PIC, JPEG, PNM, HDR, TGA, WEBP, TIFF
public sealed class Attachment : IDisposable
- Inheritance
-
Attachment
- Implements
- Inherited Members
Constructors
- Attachment(byte[], string)
Initializes a new instance of the Attachment class with the provided data and name. The data must represent one of the supported image formats:
- PNG
- BMP
- GIF
- PSD
- PIC
- JPEG
- PNM
- HDR
- TGA
- WEBP
- TIFF
- HTML
- Attachment(Stream, string)
Initializes a new instance of the Attachment class by reading the content from the provided stream and using the given file name. The stream must contain data representing one of the supported image formats:
- PNG
- BMP
- GIF
- PSD
- PIC
- JPEG
- PNM
- HDR
- TGA
- WEBP
- TIFF
- HTML
- Attachment(string)
Initializes a new instance of the Attachment class by loading the content from the specified file path. The file must be one of the supported image formats:
- PNG
- BMP
- GIF
- PSD
- PIC
- JPEG
- PNM
- HDR
- TGA
- WEBP
- TIFF
- HTML
Properties
- IsVisionRequired
Gets a value indicating whether vision processing (e.g., image analysis or OCR) is required to interpret the attachment.
- Length
Gets the length of the attachment content in bytes.
- Mime
Gets the MIME type of the attachment.
- Name
Gets the name of the attachment file.
Methods
- CreateFromBase64String(string, string)
Creates a new Attachment instance from a base64-encoded string.
- Dispose()
Ensures the release of this instance and the complete removal of all associated unmanaged resources.
- GetText()
Extracts and returns the textual content from the attachment.
- ToString()
Returns the textual content of the attachment.