Table of Contents

Method CreateFromBase64String

Namespace
LMKit.Data
Assembly
LM-Kit.NET.dll

CreateFromBase64String(string, string)

Creates a new Attachment instance from a base64-encoded string.

public static Attachment CreateFromBase64String(string data, string name)

Parameters

data string

The base64-encoded representation of the attachment content.

name string

The logical file name to associate with the attachment.

Returns

Attachment

A new Attachment initialized with the decoded bytes and given name.

Remarks

This is useful when receiving attachment data over text-based protocols or embedding within JSON/XML payloads. This method performs no I/O operations and therefore does not require an asynchronous variant.

Exceptions

ArgumentNullException

Thrown if data or name is null.

FormatException

Thrown if data is not valid base64.

UnsupportedFileTypeException

Thrown if the decoded content does not match a supported format.