首页 Object Storage Service FAQ Security compliance Permissions and access control What do I do if the object ACL configurations for resumable upload operations do not take effect?

What do I do if the object ACL configurations for resumable upload operations do not take effect?

更新时间: 2026-03-20 06:23:40

Problem description

When using OSS SDK for Java, object access control list (ACL) configurations set during a resumable upload operation do not take effect.

Causes

Resumable upload operations in OSS SDK for Java do not support configuring object ACL. Any ACL value passed through ObjectMetadata during a resumable upload is not applied to the uploaded object.

Examples

The following two code patterns both fail — the ACL is not applied to the uploaded object.

Pattern 1: Setting ACL via `setObjectAcl()`

ObjectMetadata objectMeta = new ObjectMetadata();
objectMeta.setObjectAcl(CannedAccessControlList.PublicRead);
uploadFileRequest.setObjectMetadata(objectMeta);

Pattern 2: Setting ACL via the `x-oss-object-acl` header

objectMeta.setHeader("x-oss-object-acl", "public-read");
uploadFileRequest.setObjectMetadata(objectMeta);

Solution

After the upload completes, call setObjectAcl to set the object ACL.

上一篇: How to block IP addresses in a specific region from accessing OSS resources 下一篇: Serve content from private OSS buckets
阿里云首页 对象存储 相关技术圈