RawDataFromFile Method

Creates a new RawData instance from the binary content of a file.

Definition

Namespace: FolkerKinzel.VCards.Models
Assembly: FolkerKinzel.VCards (in FolkerKinzel.VCards.dll) Version: 8.0.1+a91cc3f0fd39aeb548e16006a60ca9dd10a304a2
C#
public static RawData FromFile(
	string filePath,
	string? mediaType = null
)

Parameters

filePath  String
Path to the file.
mediaType  String  (Optional)
The Internet Media Type ("MIME type") of the file content, or null to get the mediaType automatically from the file type extension.

Return Value

RawData
The newly created RawData instance.

Exceptions

ArgumentNullExceptionfilePath is null.
ArgumentExceptionfilePath is not a valid file path.
IOExceptionThe file could not be loaded.

See Also