Transloadit 0.9.3
.NET 5.0
This package targets .NET 5.0. The package is compatible with this framework or higher.
.NET Standard 2.0
This package targets .NET Standard 2.0. The package is compatible with this framework or higher.
.NET Framework 4.5.2
This package targets .NET Framework 4.5.2. The package is compatible with this framework or higher.
dotnet add package Transloadit --version 0.9.3
NuGet\Install-Package Transloadit -Version 0.9.3
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Transloadit" Version="0.9.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Transloadit" Version="0.9.3" />
<PackageReference Include="Transloadit" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Transloadit --version 0.9.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Transloadit, 0.9.3"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Transloadit@0.9.3
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Transloadit&version=0.9.3
#tool nuget:?package=Transloadit&version=0.9.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Quick Start
Installation
Nuget package Transloadit.
Create Transloadit client
using Transloadit;
//suitable for operations not requiring signature authentication like Assembly creation,
//retrieving Assembly status, streaming Assembly changes and Assembly cancellation
var client = new TransloaditClient("<auth key>");
//for all APIs
var client = new TransloaditClient("<auth key>", "<auth secret>");
Create an Assembly
Using a Template
using Transloadit;
using Transloadit.Models.Assemblies;
var assembly = new AssemblyRequest
{
TemplateId = "c9e195983aa7459bad20a04973ca1ac1",
Fields = new Dictionary<string, object>
{
["uploadPath"] = "/main/images",
["imageId"] = "58129",
["userId"] = "73852",
},
NotifyUrl = "https://my.webhook/notify"
};
var assemblyResponse = await client.Assemblies.CreateAsync(assembly);
if (assemblyResponse.IsSuccessResponse())
{
//assembly was created and started successfully
}
else
{
//there was an error during assembly creation
}
Specifying Steps
using Transloadit;
using Transloadit.Models.Assemblies;
using Transloadit.Models.Robots;
using Transloadit.Models.Robots.FileExporting;
using Transloadit.Models.Robots.FileImporting;
var assembly = new AssemblyRequest
{
Steps = new Dictionary<string, RobotBase>
{
["ftp-import"] = new FtpImportRobot
{
Credentials = "main-ftp-creds",
PassiveMode = true,
Path = "/${fields.uploadPath}/processing/${fields.imageId}.jpg"
},
["aws-store"] = new S3StoreRobot
{
Use = "ftp-import",
Credentials = "primary-s3-bucket",
Path = "/upload/${fields.userId}/${file.url_name}",
Acl = "bucket-default",
CheckIntegrity = true,
}
},
Fields = new Dictionary<string, object>
{
["uploadPath"] = "/main/images",
["imageId"] = "58129",
["userId"] = "73852",
}
};
var assemblyResponse = await client.Assemblies.CreateAsync(assembly);
With file uploads
var assembly = new AssemblyRequest
{
TemplateId = "47c5b0b70ac64deaa821eae6424bbb4f"
};
var file = new ByteArrayContent(File.ReadAllBytes(@"/images/snowflake.jpg"));
var file1 = new ByteArrayContent(File.ReadAllBytes(@"/images/flower-field.jpg"));
var formData = new MultipartFormDataContent
{
{ file, "file-first", "snowflake.jpg" },
{ file1, "file-second", "flower-field.jpg" },
};
var assemblyResponse = await client.Assemblies.CreateAsync(assembly, formData);
Awaiting Assembly completion
var assemblyTracker = new AssemblyTracker(client);
//by id (first gets the Assembly by id and then polls the status)
var completedAssembly = await assemblyTracker.WaitCompletionAsync(createAssemblyResponse.AssemblyId);
//by assembly (checks passed Assembly and then polls the status)
var completedAssembly = await assemblyTracker.WaitCompletionAsync(createAssemblyResponse);
Create a Template and Credentials
var azureCredentials = new AzureCredentialsRequest
{
Name = "azure-storage",
Content = new AzureCredentialsContent
{
Account = "main-account",
Container = "docs-container",
Key = "secret key"
}
};
var s3Credentials = new S3CredentialsRequest
{
Name = "s3-documents",
Content = new S3CredentialsContent
{
BucketRegion = "us-east-1",
Bucket = "docs-bucket",
Secret = "secret",
Key = "key"
}
};
var azureResponse = await client.Credentials.CreateAsync(azureCredentials);
var s3Response = await client.Credentials.CreateAsync(s3Credentials);
var templateRequest = new TemplateRequest
{
Name = "sync-cloud-documents",
RequireSignatureAuth = true,
Template = new TemplateRequestContent
{
AllowStepsOverride = true,
Steps = new Dictionary<string, RobotBase>
{
["import"] = new AzureImportRobot
{
Credentials = azureCredentials.Name,
//other properties...
},
["store"] = new S3StoreRobot
{
Use = "import",
Credentials = s3Credentials.Name,
//other properties...
}
}
}
};
var templateResponse = await client.Templates.CreateAsync(templateRequest);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net452 is compatible. net46 was computed. net461 is compatible. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.5.2
- Newtonsoft.Json (>= 13.0.1)
- System.Runtime.InteropServices.RuntimeInformation (>= 4.3.0)
-
.NETFramework 4.6.1
- Newtonsoft.Json (>= 13.0.1)
- System.Runtime.InteropServices.RuntimeInformation (>= 4.3.0)
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.1)
-
net5.0
- Newtonsoft.Json (>= 13.0.1)
-
net6.0
- Newtonsoft.Json (>= 13.0.1)
-
net7.0
- Newtonsoft.Json (>= 13.0.1)
-
net8.0
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.