DataUrlAppendFileTo(StringBuilder, String, MimeTypeInfo, DataEncoding) Method

Appends the content of a file as "data" URL (RFC 2397) to the end of a StringBuilder.

Definition

Namespace: FolkerKinzel.DataUrls
Assembly: FolkerKinzel.DataUrls (in FolkerKinzel.DataUrls.dll) Version: 1.0.0+b1c843815044ca6fd87a144c9ff16386002c6473
C#
public static StringBuilder AppendFileTo(
	StringBuilder builder,
	string filePath,
	 in MimeTypeInfo mimeType,
	DataEncoding encoding = DataEncoding.Base64
)

Parameters

builder  StringBuilder
The StringBuilder to which a "data" URL is appended.
filePath  String
Abolute path to the file whose content is to embed in the "data" URL.
mimeType  MimeTypeInfo
The Internet Media Type ("MIME type") of the file whose content is to embed.
encoding  DataEncoding  (Optional)
The encoding to use to embed the file content.

Return Value

StringBuilder
A reference to builder.

Exceptions

ArgumentNullExceptionbuilder or filePath, is null.
ArgumentException

filePath is not a valid file path

- or -

mimeType is an empty struct.

IOExceptionI/O error.

See Also