Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
[Route("api/[controller]")]
[ApiController]
public class ImageController : ControllerBase
{
private const int TIMEOUT = 2500;
// Digital Ocean settings
private static readonly string S3LoginRoot = "https://nyc3.digitaloceanspaces.com/";
private static readonly string S3BucketName = "";
private static readonly string AccessKey = "";
private static readonly string AccessKeySecret = "";
private static readonly string S3FolderName = "";
[HttpPost]
public IActionResult Post([FromForm] IFormFile file)
{
bool Sucesso = false;
try
{
AmazonS3Client? s3Client = new(new BasicAWSCredentials(AccessKey, AccessKeySecret), new AmazonS3Config
{
ServiceURL = S3LoginRoot,
Timeout = TimeSpan.FromSeconds(TIMEOUT),
MaxErrorRetry = 8,
});
TransferUtility fileTransferUtility = new(s3Client);
TransferUtilityUploadRequest? fileTransferUtilityRequest = new()
{
BucketName = S3BucketName + @"/" + S3FolderName,
Key = file.FileName,
InputStream = file.OpenReadStream(),
ContentType = file.ContentType,
StorageClass = S3StorageClass.StandardInfrequentAccess,
PartSize = 6291456,
CannedACL = S3CannedACL.PublicRead,
};
fileTransferUtility.Upload(fileTransferUtilityRequest);
Sucesso = true;
}
catch (Exception Ex)
{
Console.WriteLine(Ex.Message);
}
return Ok(new { Sucesso });
}
}
Updating