How to Scan an AWS S3 File for Viruses in C#

Install-Package Cloudmersive.APIClient.NET.VirusScan -Version 3.0.3
using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.VirusScan.Api;
using Cloudmersive.APIClient.NET.VirusScan.Client;
using Cloudmersive.APIClient.NET.VirusScan.Model;
namespace Example
{
public class ScanCloudStorageScanAwsS3FileExample
{
public void main()
{
// Configure API key authorization: Apikey
Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
var apiInstance = new ScanCloudStorageApi();
var accessKey = accessKey_example; // string | AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console
var secretKey = secretKey_example; // string | AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console
var bucketRegion = bucketRegion_example; // string | Name of the region of the S3 bucket, such as 'US-East-1'
var bucketName = bucketName_example; // string | Name of the S3 bucket
var keyName = keyName_example; // string | Key name (also called file name) of the file in S3 that you wish to scan for viruses
try
{
// Scan an AWS S3 file for viruses
CloudStorageVirusScanResult result = apiInstance.ScanCloudStorageScanAwsS3File(accessKey, secretKey, bucketRegion, bucketName, keyName);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling ScanCloudStorageApi.ScanCloudStorageScanAwsS3File: " + e.Message );
}
}
}
}

--

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Ultimate Guide to PyTrends: the Google Trends API (with Python code examples)

The road to a white label solution

How to create a Web-Based Document Viewer in PHP

Why I love The New LinkedIn Interface

Steps to Launch Top-Performance Mobile Application in your Budget

My experience in cybersecurity bootcamp in Ironhack.

Starting a Third-Party activity for result the clean way

Docker Developer Guide#02

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Translate French to English Text with Deep Learning AI in C#

Docker, nginx and reverse-proxying

Rsync from macOS to Linux Server

Git & Git Commands