![]() |
VOOZH | about |
dotnet add package TAF.FileManager.SDK --version 1.2.5
NuGet\Install-Package TAF.FileManager.SDK -Version 1.2.5
<PackageReference Include="TAF.FileManager.SDK" Version="1.2.5" />
<PackageVersion Include="TAF.FileManager.SDK" Version="1.2.5" />Directory.Packages.props
<PackageReference Include="TAF.FileManager.SDK" />Project file
paket add TAF.FileManager.SDK --version 1.2.5
#r "nuget: TAF.FileManager.SDK, 1.2.5"
#:package TAF.FileManager.SDK@1.2.5
#addin nuget:?package=TAF.FileManager.SDK&version=1.2.5Install as a Cake Addin
#tool nuget:?package=TAF.FileManager.SDK&version=1.2.5Install as a Cake Tool
HTTP-based SDK for TAF FileManager Service. Provides BusContext extension methods for fetching images as streams, designed for Base64 image embedding in PDF reports.
dotnet add package TAF.FileManager.SDK
context.GetImageAsync(path) extension methodcontext.GetImageAsBase64Async(path) for direct Base64 conversion// Option 1: Using configuration
builder.Services.AddFileManagerClient(builder.Configuration);
// Option 2: Using manual options
builder.Services.AddFileManagerClient(options =>
{
options.BaseUrl = "https://localhost:44341";
options.TimeoutSeconds = 30;
});
var app = builder.Build();
// Initialize after building the service provider
app.Services.InitializeFileManagerExtensions();
{
"FileManagerService": {
"BaseUrl": "https://localhost:44341",
"Timeout": 30
}
}
// In any service/handler with BusContext
var imageStream = await context.GetImageAsync("/uploads/logo.png");
if (imageStream != null)
{
using var memoryStream = new MemoryStream();
await imageStream.CopyToAsync(memoryStream);
var base64 = Convert.ToBase64String(memoryStream.ToArray());
// Use in PDF, HTML, etc.
var imgSrc = $"data:image/png;base64,{base64}";
}
// Direct Base64 conversion
var base64Image = await context.GetImageAsBase64Async("/uploads/logo.png");
if (base64Image != null)
{
var imgSrc = $"data:image/png;base64,{base64Image}";
}
// Get icon type image
var iconStream = await context.GetImageAsync("/icons/user.png", type: "Icon");
// Get with record ID
var recordImage = await context.GetImageAsync("/images/profile.png", recordId: "12345");
null (graceful handling)HttpRequestExceptionTimeoutExceptionOperationCanceledExceptiontry
{
var imageStream = await context.GetImageAsync("/uploads/logo.png");
if (imageStream == null)
{
// Image not found - use default or skip
_logger.LogWarning("Image not found: /uploads/logo.png");
}
}
catch (HttpRequestException ex)
{
_logger.LogError(ex, "Failed to fetch image from FileManager");
}
| Method | Description | Returns |
|---|---|---|
GetImageAsync(path, type?, recordId?, ct?) |
Get image as stream | Task<Stream?> |
GetImageAsBase64Async(path, type?, recordId?, ct?) |
Get image as Base64 | Task<string?> |
| Parameter | Type | Default | Description |
|---|---|---|---|
path |
string |
required | Path to the image file |
type |
string |
"Standard" | Image type ("Standard", "Icon", etc.) |
recordId |
string? |
null | Optional record ID |
cancellationToken |
CancellationToken |
default | Cancellation token |
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 was computed. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.