Ran into the following signature mismatch exception while trying to upload a file into a folder on using using AWS .Net SDK.
“Amazon.S3.AmazonS3Exception : The request signature we calculated does not match the signature you provided. Check your key and signing method.”
Uploading files in the root of the bucket worked fine, but, the signature calculated by the SDK didn’t match the server calculated signature while trying to upload to a folder. The problem turned out to be the path separator, AWS include object key while calculating request signature, but, the server is using ‘/’ as path separator, while the SDK uses whatever you set. Since most the .Net functions use ‘\’ to separate paths make sure to replace the separator while creating the request.
Using Unix style path separator fixed the problem.