0
DownloadFileRequest downloadFileRequest = DownloadFileRequest.builder()
                .getObjectRequest(b -> b.bucket(bucketName).key(key))
                .addTransferListener(LoggingTransferListener.create())
//              .destination(Paths.get(key))  try to download to browser, but always failed, got an page code file, looks like it download the page instead of the file in s3 bucket
                .destination(new File("C:\\aa.TXT"))  // this one always work
FileDownload downloadFile = transferManager.downloadFile(downloadFileRequest);

CompletedFileDownload downloadResult = downloadFile.completionFuture().join();

I want to on the page, click a link, download the file, browser let you choose file folder.

0