Skip to content

PluginDownload

Class in Oadm.Sdk.Plugins · Oadm.Sdk.dll

A file a core plugin sends to its client page through gRPC PluginService.Download (ICorePluginDownloads.OpenDownloadAsync): the host copies PluginDownload.Content to the client in chunks and disposes the download afterwards, also when the client cancels. Nothing is stored on the server, so a plugin can pass a device answer straight on (e.g. a recording export opened with VapixRequestOptions.StreamResponse).

public sealed class PluginDownload : IAsyncDisposable

Implements IAsyncDisposable

PluginDownload(Stream content, string fileName, long? length = null, IDisposable? owner = null)

Parameters

  • content: The bytes, read once from the start; disposed with the download.
  • fileName: The suggested file name (no folder), e.g. the name the device sent.
  • length: The length in bytes when known, else null.
  • owner: Disposed after content, e.g. the device response the stream belongs to.
string? AuditDetail { get; init; }

What the audit entry of an audited download says (ICorePlugin.IsAudited), e.g. the device and the time range; null = the method name. Never a secret.

Stream Content { get; }

The bytes; read with your own token.

string FileName { get; }

The suggested file name.

long? Length { get; }

The size in bytes when known.

ValueTask DisposeAsync()

Disposes the stream and its owner (e.g. the device response it reads from).