Transloadit 0.9.4
.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.4
NuGet\Install-Package Transloadit -Version 0.9.4
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.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Transloadit" Version="0.9.4" />
<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.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Transloadit, 0.9.4"
#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.4
#: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.4
#tool nuget:?package=Transloadit&version=0.9.4
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
// or retrieving assembly status
var clientNoAuth = new TransloaditClient("<auth key>");
// for all APIs (including those that require signature authentication)
var client = new TransloaditClient("<auth key>", "<auth secret>");
With custom JSON serializer settings
using Transloadit;
using Transloadit.Serialization;
var settings = TransloaditSerializerSettings.CreateDefault();
settings.Converters.Add(new MyCustomConverter());
var options = new TransloaditClientOptions
{
RequestSerializerSettings = settings,
ResponseSerializerSettings = settings,
};
var client = new TransloaditClient("<auth key>", "<auth secret>", options);
Create an Assembly
Using a template
using System.Collections.Generic;
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 System.Collections.Generic;
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
using System.IO;
using System.Net.Http;
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(assemblyResponse.AssemblyId);
// by assembly (checks the passed assembly and then polls the status)
var completedAssembly2 = await assemblyTracker.WaitCompletionAsync(assemblyResponse);
Create a template and credentials
using System.Collections.Generic;
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 is compatible. 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 is compatible. 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 is compatible. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 is compatible. 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)
-
.NETFramework 4.6.2
- Newtonsoft.Json (>= 13.0.1)
- System.Runtime.InteropServices.RuntimeInformation (>= 4.3.0)
-
.NETFramework 4.7.2
- Newtonsoft.Json (>= 13.0.1)
-
.NETFramework 4.8
- Newtonsoft.Json (>= 13.0.1)
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.1)
-
net10.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)
-
net9.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.