title: Amazon S3 Presigned URLs escape the slashes in the key
body: <p>I am using the Java Amazon SDK to work with S3 for storing uploaded files. I would like to retain the original filename, and I am putting it at the end of the key, but I am also using virtual directory structure - something like <code>&lt;dirname&gt;/&lt;uuid&gt;/&lt;originalFilename&gt;</code>.</p>
  
  <p>The problem is that when I want to generate a presigned URL for downloading using the api like:</p>
  
  <pre><code>URL url = s3Client.generatePresignedUrl(generatePresignedUrlRequest);
  return url.toExternalForm();
  </code></pre>
  
  <p>The sdk url escapes the entire key, including the slashes. While it still works, it means that the name of the file downloaded includes the entire key instead of just the original filename bit at the end. I know that it should be possible to do this without escaping the slashes, but I'm trying to avoid rewriting a lot of the code already in the SDK. Is there a common solution to this? I know I've used web apps that follow the same pattern and do not have the slash escape problem.</p>