【问题标题】:Set permission with aws object using transferobserver android使用 transferobserver android 设置 aws 对象的权限
【发布时间】:2016-05-31 20:33:21
【问题描述】:
private void beginUpload(String filePath) {
        if (filePath == null) {
            Toast.makeText(this, "Could not find the filepath of the selected file", Toast.LENGTH_LONG).show();
            return;
        }

        File file = new File(filePath);
        TransferObserver observer = transferUtility.upload(Constants.BUCKET_NAME, file.getName(), file);
        observers.add(observer);
        HashMap<String, Object> map = new HashMap<String, Object>();
         Util.fillMap(map, observer, false);
        transferRecordMaps.add(map);
        observer.setTransferListener(new UploadListener());
        simpleAdapter.notifyDataSetChanged();
    }

【问题讨论】:

    标签: android amazon-s3


    【解决方案1】:

    在您当前的存储桶上使用PutObjectRequest 设置权限并像this 这样的文件

    if(this.publicRead)
    {
        por.setCannedAcl(CannedAccessControlList.PublicRead);
    }
    

    【讨论】:

      猜你喜欢
      • 2020-05-16
      • 2017-05-04
      • 1970-01-01
      • 1970-01-01
      • 2012-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多