title: S3 generate download link
body: <p>I'm having trouble generating a download link for an html file i'm uploading to aws s3 server. I am able to generate the link and access the file. But what I want to happen is that when I click the link is for the file to be downloaded instead of opening it.</p>
  
  <p>Here is and example of the url: </p>
  
  <pre><code>https://wassap_app.s3.us-east-1.amazonaws.com/report/test.html
  </code></pre>
  
  <p>Below is the code for the method that does the upload:</p>
  
  <pre><code>public boolean uploadFile(String name) {
      try {
          this.client.putObject(new PutObjectRequest(bucketName, "report/" + name, this.file)
                  .withCannedAcl(CannedAccessControlList.PublicRead));
          String url = client.getUrl(bucketName, "report/" + name).toExternalForm();
          System.out.println("################ Download File URL ################");
          System.out.println(url);
          System.out.println("###################################################");
          return true;
      } catch (AmazonServiceException ase) {
          return false;
      } catch (AmazonClientException ace) {
          return false;
      }
  
  }
  </code></pre>