Table of Contents

Class File

Namespace
NuvTools.Storage
Assembly
NuvTools.Storage.dll

Represents a file with its metadata and content. Supports three initialization modes: URI-only, stream-based, or Base64-encoded content.

public class File : IFile
Inheritance
File
Implements
Inherited Members
Extension Methods

Constructors

File(string, string, Stream)

Initializes a new instance of the File class with stream content. The stream is automatically converted to a Base64-encoded string.

public File(string name, string type, Stream content)

Parameters

name string

The name of the file.

type string

The MIME type of the file.

content Stream

The file content as a stream.

File(string, string, string)

Initializes a new instance of the File class with Base64-encoded content. The Base64 string is automatically converted to a stream.

public File(string name, string type, string base64String)

Parameters

name string

The name of the file.

type string

The MIME type of the file.

base64String string

The file content as a Base64-encoded string.

File(string, string, Uri)

Initializes a new instance of the File class with a URI location.

public File(string name, string type, Uri uri)

Parameters

name string

The name of the file.

type string

The MIME type of the file.

uri Uri

The URI location of the file in storage.

Properties

Base64String

Gets the file content as a Base64-encoded string.

public string? Base64String { get; }

Property Value

string

Content

Gets the file content as a stream.

public Stream? Content { get; }

Property Value

Stream

Name

Gets the name of the file.

public string Name { get; }

Property Value

string

Type

Gets the MIME type of the file.

public string Type { get; }

Property Value

string

Uri

Gets the URI location of the file in storage.

public Uri? Uri { get; }

Property Value

Uri