Sanitize | C# SDK
Sanitize
SanitizeClientSanitize client.
var config = new Config("pangea_token", "pangea_domain");
var builder = new SanitizeClient.Builder(config);
var client = builder.Build();
Sanitize
SanitizeClient.Sanitize(SanitizeRequest, FileStream)Apply file sanitization actions according to specified rules.
var file = new FileStream("/path/to/file.pdf", FileMode.Open, FileAccess.Read);
var response = await client.Sanitize(
new SanitizeRequest()
{
RequestTransferMethod = TransferMethod.PostURL,
UploadedFileName = "uploaded_file",
},
file
);
Sanitize via presigned URL
SanitizeClient.RequestUploadURL(SanitizeRequest)Apply file sanitization actions according to specified rules via a presigned URL.
var presignedUrl = await client.RequestUploadURL(
new SanitizeRequest()
{
RequestTransferMethod = TransferMethod.PutURL,
UploadedFileName = "uploaded_file",
}
);
// Upload file to `presignedUrl.Result.PutURL`.
// Poll for Sanitize's result.
var response = await client.PollResult<SanitizeResult>(presignedUrl.RequestId);