Class OpenBiSessionFileExtensions
Extension methods for uploading and downloading files.
Inheritance
OpenBiSessionFileExtensions
Namespace: BiExcellence.OpenBi.Api.Commands.Files
Assembly: BiExcellence.OpenBi.Api.dll
Syntax
public static class OpenBiSessionFileExtensions
Methods
DeleteFileAsync(IOpenBiSession, string, string, string, CancellationToken)
Delete a file from the server.
Declaration
public static Task DeleteFileAsync(this IOpenBiSession session, string area, string parent, string filename, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSession | session | The session. |
string | area | The top level folder name. |
string | parent | The second level folder name. |
string | filename | The file name. |
CancellationToken | cancellationToken | The cancellation token. |
Returns
Type | Description |
---|---|
Task |
DownloadFileAsync(IOpenBiSessionHttpClient, string, CancellationToken)
Downloads a file from the server.
Declaration
public static Task<Stream> DownloadFileAsync(this IOpenBiSessionHttpClient session, string elementId, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSessionHttpClient | session | The session. |
string | elementId | The element id which should be downloaded. |
CancellationToken | cancellationToken | The cancellation token to cancel the download. |
Returns
Type | Description |
---|---|
Task<Stream> | A stream which contains the files contents. |
UploadFileAsync(IOpenBiSessionHttpClient, Stream, string, string, string, CancellationToken)
Uploads a new file to the server.
Declaration
public static Task<string> UploadFileAsync(this IOpenBiSessionHttpClient session, Stream stream, string area, string parent, string filename, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
IOpenBiSessionHttpClient | session | The session. |
Stream | stream | The stream for the file contents. |
string | area | The top level folder name. |
string | parent | The second level folder name. |
string | filename | The file name. |
CancellationToken | cancellationToken | The cancellation token to cancel the upload. |
Returns
Type | Description |
---|---|
Task<string> | The element id of the uploaded file. |