I am trying to upload files on Amazon s3 bucket in a very simple way, but it gives error if the file name consists of "(" or ")" , i dont want remove or replace these braces as they are required for my case
Code :
AWSCredentials awsCredentials = new BasicAWSCredentials("accessKey", "secretKey");
AmazonS3 s3 = new AmazonS3Client(awsCredentials);
String fileName = "TEST_FILE_(NAME).pdf";
String directorykey = "path/to/amazon/directory";
File file = new File(/* path_to_file + */ fileName);
try {
s3.putObject(bucketName, directorykey+"/"+fileName , file);
} catch (AmazonServiceException e) {
LOG.fatal("Failed to store file to bucket: " , e);
} catch (AmazonClientException e) {
LOG.fatal("Failed to store file to bucket: " , e);
}
ERROR :
Status Code: 403; Error Code: SignatureDoesNotMatch; Request ID: tx000000000000002e9edee-005a4ed3d2-2213a2-uky-campus-1; S3 Extended Request ID: 123456789)