OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

PermanentRedirect error while uploading to S3 bucket with aws-sdk-java

  • Thread starter Thread starter ishanbakshi
  • Start date Start date
I

ishanbakshi

Guest
I am trying to upload a file from a java class to aws S3.

I am using the exact code as given here

The only parts I changed are these:

Code:
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";

I am not sure what to add in Provide Key . But even if I leave it this way, i get an error like this :

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
<p>I am trying to upload a file from a java class to aws S3.</p>

<p>I am using the exact code as given <a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/UploadObjSingleOpJava.html" rel="nofollow">here</a></p>

<p>The only parts I changed are these:</p>

<pre><code>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";
</code></pre>

<p>I am not sure what to add in <em>Provide Key</em> . But even if I leave it this way, i get an error like this :</p>

<blockquote>
<p>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</p>
</blockquote>
Continue reading...
 

Latest posts

Top