title: Amazon S3 download a file at client location
body: <p>I have my application that downloads the file form AWS S3 bucket. I am using below code:</p>
  
  <pre><code>public void downloadFileFromS3(String key) throws IOException, InterruptedException{
          LOG.info("Start - downloadFileFromS3 for key: {} and bucket name: {}", key, bucketName);
          initAWS();
          final GetObjectRequest request = new GetObjectRequest(bucketName, key);
          Download download = transferMgr.download(request, new File("D:\\rohit\\"+key));
          download.waitForCompletion();
  }
  </code></pre>
  
  <p>Now, as we see the file destination path at client's end is hardcoded as <strong>D:\rohit</strong>. But, in the real world application when user clicks on <strong>download a file</strong> option, the file gets downloaded directly at client end's download folder.</p>
  
  <p>Could someone please help me with file destination path. I am using <strong>Java &amp; Spring Boot</strong>.</p>
  
  <p>I tried searching on the net and found various solutions on stakeoverflow as well. But, the solutions didn't help:</p>
  
  <p><a href="https://stackoverflow.com/questions/41984750/download-file-from-amazon-s3-using-rest-api">Download file from Amazon S3 using REST API</a></p>
  
  <p><a href="https://stackoverflow.com/questions/16799956/javascript-to-download-a-file-from-amazon-s3-bucket">Javascript to download a file from amazon s3 bucket?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/13427895/download-a-file-to-particular-location-in-client-system">download a file to particular location in client system</a></p>