I have my application that downloads the file form AWS S3 bucket. I am using below 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();
}
Now, as we see the file destination path at client's end is hardcoded as D:\rohit. But, in the real world application when user clicks on download a file option, the file gets downloaded directly at client end's download folder.
Could someone please help me with file destination path. I am using Java & Spring Boot.
I tried searching on the net and found various solutions on stakeoverflow as well. But, the solutions didn't help:
Download file from Amazon S3 using REST API