OSS returns HTTP status code 412 when a conditional download request fails because the object does not meet the specified preconditions.
PreconditionFailed
Error message: At least one of the pre-conditions you specified did not hold
The following two request headers can trigger this error. Identify which header you specified and apply the corresponding fix.
| Header | Trigger condition | Fix |
|---|---|---|
If-Unmodified-Since | The object was modified after the time you specified. | Set the header value to a time equal to or later than the object's last modified time. |
If-Match | The ETag in the header does not match the object's ETag. | Set the header value to the exact ETag of the object. |
If-Unmodified-Since
Trigger: The object has been modified after the time specified in If-Unmodified-Since.
Fix: Set If-Unmodified-Since to a time equal to or later than the object's last modified time.
If-Match
Trigger: The ETag value in If-Match does not match the ETag of the object.
Fix: Set If-Match to the exact ETag value of the object you want to download.
该文章对您有帮助吗?