title: Cloudfront Signed URLs not working with S3 content disposition filenames with spaces using .NET SDK
body: <p>I have setup Cloudfront Signed URLs with an S3 origin correctly and am using the <code>response-content-disposition</code> query string parameter to specify the file download name.  The signed URLs I generate using the .NET AWS SDK <code>AmazonCloudFrontUrlSigner.GetCannedSignedURL</code> method <em>work correctly when the content disposition filename doesn't contain spaces</em>.  However, if the filename contains spaces, I get access denied. So, something like the code below will generate a URL that gives access denied.</p>
  
  <pre><code>var contentDisposition = HttpUtility.UrlEncode("attachment;filename=My File.txt");
  var key = "example.txt?response-content-disposition="+contentDisposition;
  return AmazonCloudFrontUrlSigner.GetCannedSignedURL(
      AmazonCloudFrontUrlSigner.Protocol.https,
      "myBucket",
      cloudFrontPrivateKey,
      key, cloudFrontAccessKeyId, expirationDateTime);
  </code></pre>
  
  <p>It clearly seems to have something to do with the URL encoding.</p>
  
  <p>I have read through all the information in the docs about <a href="http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html" rel="nofollow">Serving Private Content through CloudFront</a>.  I read the <a href="https://github.com/emcvipr/dataservices-sdk-dotnet/blob/master/AWSSDK/Amazon.CloudFront/AmazonCloudFrontUrlSigner.cs" rel="nofollow">code of the <code>AmazonCloudFrontUrlSigner</code> class</a>. I've also tried an number of combinations of <code>UrlEncode</code> like not encoding, encoding only the filename portion and even not encoding but replacing with the encoded version after the signed URL is generated.  All of those either give access denied or an error that the signature doesn't match the url.</p>