I am trying to transfer files from a network drive to an AWS S3 subfolder. In the debug mode, When the code reaches the line where UploadDirectoryAsync is called, it appears to run as if the files are being uploaded successfully, and no errors are thrown.

However, when I check the S3 bucket, I do not see any files in the destination subfolder.

Below is the code I am using. Could someone let me know if I might be missing something or if there is anything I should check?

public async Task BulkUpload() { try { var S3client = new AmazonS3Client(_configuration["AwsAccesKey"].ToString(), _configuration["AwsSecretKey"].ToString(), RegionEndpoint.USWest2); var directoryTransferUtility = new TransferUtility(S3client); var request = new TransferUtilityUploadDirectoryRequest { BucketName = _configuration["AwsBucketName"].ToString() + @"/" + "SubFiles", Directory = @"\\TestFileserver\FileR\", SearchOption = SearchOption.AllDirectories, SearchPattern = "*.*" }; await directoryTransferUtility.UploadDirectoryAsync(request); } catch (Exception ex) { } }

rimi's user avatar

1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.