I am having a problem with PutObject on S3, and keep receiving the following WebException
“A redirect was returned without a new location. This can be caused by attempting to access buckets with periods in the name in a different region then the client is configured for.”
The code I am using is very simple:
AmazonS3 client = Amazon.AWSClientFactory.CreateAmazonS3Client(accessKey, secretAccessKey);
PutObjectRequest request = new PutObjectRequest();
request.WithBucketName("my.url.com");
request.WithKey("myfilename.txt");
request.FilePath = filePath;
request.ContentType = podcastFile.PostedFile.ContentType;
request.StorageClass = S3StorageClass.ReducedRedundancy;
request.CannedACL = S3CannedACL.PublicRead;
client.PutObject(request);
Could anybody shed any light on this?
Cheers,
Dave
What region is your bucket in?
You might need to specify the correct URL to connect to via:
and then using that config as part of your call to CreateAmazonS3Client.