How to download a file from s3 using provided url?

Viewed 79664
8 Answers

Just enter the url on the browser but make sure to replace \u0026 with & if you have downloaded the url via curl else you will get this error

<Error>
    <Code>AuthorizationQueryParametersError</Code>
    <Message>X-Amz-Algorithm only supports "AWS4-HMAC-SHA256"</Message>
</Error>

You can't, but you can make the file attachment in the upload.

For example:

ObjectMetadata objectMetadata = new ObjectMetadata();
objectMetadata.setContentType("application/csv;charset=utf-8");
objectMetadata.setContentDisposition("attachment");
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, arquivo, file, objectMetadata).withCannedAcl(CannedAccessControlList.PublicRead);
amazonS3.putObject(putObjectRequest);

I hope it helps.

Related