Skip to content

AWSSDK.S3 > v3.7.10.1 AmazonS3Client Forbidden Response #2621

Answered by ajangles
ajangles asked this question in Q&A
Discussion options

You must be logged in to vote

Hi Ashish, thank you for your reply, the verbose logging helped me find the answer. It seems that <= v3.7.10.1 you could set the path in the BucketName property, but that now no longer works

var request = new GetObjectMetadataRequest()
 {
          BucketName = bucketName, //eg - bucket/folderOne/folderTwo
          Key = fileKey, //eg - someFile.pdf 
};

I saw that it was escaping some of the '/' characters in the path incorrectly in the verbose logging:

Amazon Verbose: 0 : Single encoded /bucketName%2FfolderOne%2FfolderTwo/someFile.pdf with endpoint https://s3.ap-southeast-2.amazonaws.com/bucketName%2FfolderOne%2FfolderTwo for canonicalization: /bucketName%252FfolderOne%252FfolderTwo/so…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ashishdhingra
Comment options

Answer selected by ashishdhingra
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. s3
2 participants