public static void UploadFile(string file, string awsPath) { PutObjectRequest request = new PutObjectRequest() { FilePath = file, BucketName = ConfigurationManager.AppSettings["AWSBucketName"], Key = awsPath }; if (!bool.Parse(ConfigurationManager.AppSettings["ManagedEncryption"])) { request.WithServerSideEncryptionMethod(ServerSideEncryptionMethod.AES256); } else { request.WithMetaData("customencrypt", "true"); } var responce = S3.PutObject(request); }