我正在尝试将文件从 java 类上传到 aws S3。
我正在使用给定的确切代码 here
我唯一改变的部分是:
private static String bucketName = "s3-us-west-2.amazonaws.com/<my-bubket-name>";
private static String keyName = "*** Provide key ***";
private static String uploadFileName = "/home/...<localpath>.../test123";
我不确定要在 Provide Key 中添加什么。但即使我这样离开,我也会收到这样的错误:
Error Message: The bucket is in this region: null.Please use this region to retry the request (Service: Amazon S3; Status Code: 301; Error Code: PermanentRedirect; Request ID: *******) HTTP Status Code: 301 AWS Error Code: PermanentRedirect Error Type: Client
最佳答案
而不是 s3-us-west-2.amazonaws.com/<my-bucket-name>
你应该把<my-bucket-name>
.
关于java - 使用 aws-sdk-java 上传到 S3 存储桶时出现 PermanentRedirect 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39061774/