У меня есть этот фрагмент кода:
private String putS3Object(String objectKey, String mimeType, byte[] content) {
log.info("adding {} - {} - to {} ", objectKey, mimeType, bucketName);
try {
PutObjectResponse response = s3.putObject(PutObjectRequest.builder()
.bucket(bucketName)
.contentType(mimeType)
.key(objectKey)
.acl(ObjectCannedACL.PUBLIC_READ)
.build(),
RequestBody.fromBytes(content));
return response.eTag();
} catch (S3Exception e) {
log.error(e.getMessage());
}
return "";
}
но у меня такая ошибка:
The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. (Service: S3, Status Code: 301, Request ID: L75KCJ8A7K7WGQNS, Extended Request ID: BsqLF6F+HWW1CoEtVgZxe455hjsacpWCmWIXxwVFn7EnZgYleNPM7N818XYT8KP+8IpkWUA+iMOCRdgUFsy24438Q==)
и попробовать это нормально:
aws s3 cp pullpointer.svg s3://myxwavep/
Подробнее здесь: https://stackoverflow.com/questions/792 ... dressed-us
Awssdk.services.s3: к сегменту, к которому вы пытаетесь получить доступ, необходимо обращаться с использованием указанно ⇐ JAVA
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение