0

viI am trying to upload file to a Amazon S3 server from android app using signed url which is generated from server side, its working fine on our testing Amazon s3 account but its return 'Access Denied' error for live account with new bucket name.

<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>my requestid</RequestId><HostId> my hostid </HostId></Error>

upload code:

public void UploadObject(String signed_url ) throws IOException
 { 
     HttpClient client = new DefaultHttpClient();
     HttpPut post = new HttpPut(signed_url);

     // uploading video file:
     post.setEntity(new FileEntity(getMyVideoFile(), "video/mp4")); 

     HttpResponse response = client.execute(post);
     HttpEntity entity = response.getEntity();
     String responseString = EntityUtils.toString(entity, "UTF-8");
 }

its working fine in ios for both account(signed url generated from same server side),Any help will be appreciated.

Shijil
  • 2,226
  • 18
  • 33
  • 1
    You will probably need to post your Bucket Policy, signing code, and upload code. There is not a way to diagnose this based only on this error message. – worpet Mar 04 '15 at 15:24
  • The signature of a signed url is only valid for the bucket name originally used when creating the signature. You aren't trying to use the *exact same* signature on two different buckets, right? – Michael - sqlbot Mar 04 '15 at 21:25
  • @ Michael we generate separate signed url for each bucket using same method(credentials, bucket name .. are different). please note signed urls works fine in ios. – Shijil Mar 05 '15 at 13:30
  • Done using Retrofit lib, see this answer http://stackoverflow.com/a/32439404/2562861 – Shijil Sep 07 '15 at 13:10

0 Answers0