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
namestringThe name of the file.
typestringThe MIME type of the file.
contentStreamThe 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
namestringThe name of the file.
typestringThe MIME type of the file.
base64StringstringThe 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
namestringThe name of the file.
typestringThe MIME type of the file.
uriUriThe URI location of the file in storage.
Properties
Base64String
Gets the file content as a Base64-encoded string.
public string? Base64String { get; }
Property Value
Content
Gets the file content as a stream.
public Stream? Content { get; }
Property Value
Name
Gets the name of the file.
public string Name { get; }
Property Value
Type
Gets the MIME type of the file.
public string Type { get; }
Property Value
Uri
Gets the URI location of the file in storage.
public Uri? Uri { get; }