Skip to content

IPluginUploads

Interface in Oadm.Sdk.Plugins · Oadm.Sdk.dll

SDK 0.15.0: files a core plugin keeps itself (in its ICorePluginContext.DataDirectory) handed to the tasks it starts as uploads (ICorePluginContext.Uploads): a task reads files only by an upload id, and uploads are deleted after a day, so the plugin adds its file again when IPluginUploads.FindAsync no longer finds the last id. The uploads belong to the system: tasks the plugin starts with ICorePluginContext.Tasks read them.

public interface IPluginUploads
Task<UploadedFile> AddAsync(string fileName, Stream content, long size, CancellationToken ct)

Adds size bytes of content as an upload named fileName and answers it. Throws InvalidOperationException with the reason for the user when the server refuses it (over the upload limit, the disk full).

Task<UploadedFile?> FindAsync(string fileId, CancellationToken ct)

The upload with this id; null when it is gone.