上载期间从s3访问被拒绝的响应

时间:2015-03-04 13:38:00

标签: java android amazon-web-services amazon-s3

vi我正在尝试使用从服务器端生成的签名网址从Android应用程序将文件上传到Amazon S3服务器,它在我们测试的亚马逊s3帐户上工作正常,但是对于新的真实帐户,它返回'Access Denied'错误桶名。

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

上传代码:

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");
 }

它在两个帐户的ios中工作正常(从同一服务器端生成的签名网址),任何帮助将不胜感激。

0 个答案:

没有答案