Attachment |
public MimeEntity Add( string fileName, Stream stream, ContentType contentType, CancellationToken cancellationToken = default )
Exception | Condition |
---|---|
ArgumentNullException | fileName is null. -or- stream is null. -or- contentType is null. |
ArgumentException | The specified file path is empty. |
IOException | An I/O error occurred. |
OperationCanceledException | The operation was canceled via the cancellation token. |
Adds the specified data as an attachment using the supplied Content-Type.
The file name parameter is used to set the Content-Location.
For a list of known mime-types and their associated file extensions, see http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types