Creates a symbol link directing to the target object. You can use the symbol link to access the target object.
PUT /ObjectName?symlink HTTP/1.1 Host: BucketName.oss-cn-hangzhou.aliyuncs.com Date: GMT Date Authorization: SignatureValue x-oss-symlink-target: TargetObjectName
|x-oss-symlink-target||String||Yes||Indicates the target object that the symbolic link directs to.
Valid value: The naming conventions are the same as those for objects.
|x-oss-storage-class||String||No|| Specifies the storage class of the target object.
Supported APIs: PutObject, InitMultipartUpload, AppendObject, PutObjectSymlink, and CopyObject
- When a symbolic link is created, the following checks are not performed:
- Whether the target object exists.
- Whether the storage class of the target object is valid.
- Whether the user has permission to access the target object.
These checks are performed by APIs that access the target object, such as GetObject.
- If the object that you want to add already exists and you can access the object, the existing object is overwritten by the added object and a 200 OK message is returned.
- If a PutSymlink request carries a parameter with the x-oss-meta- prefix, the parameter is considered as user meta, such as x-oss-meta-location. An object can have multiple parameters with the x-oss-meta- prefix. However, the total size of all user meta cannot exceed 8 KB.
PUT /link-to-oss.jpg? symlink HTTP/1.1 Host: oss-example.oss-cn-hangzhou.aliyuncs.com Cache-control: no-cache Content-Disposition: attachment;filename=oss_download.jpg Date: Tue, 08 Nov 2016 02:00:25 GMT Authorization: OSS qn6qrrqxo2oawuk53otfjbyc:kZoYNv66bsmc10+dcGKw5x2PRrk= x-oss-symlink-target: oss.jpg x-oss-storage-class: Standard
HTTP/1.1 200 OK Server: AliyunOSS Date: Tue, 08 Nov 2016 02:00:25 GMT Content-Length: 0 Connection: keep-alive x-oss-request-id: 582131B9109F4EE66CDE56A5 ETag: "0A477B89B4602AA8DECB8E19BFD447B6"
The SDKs of this API are as follows:
|Error code||HTTP status code||Description|
|InvalidArgument||400||The value of x-oss-storage-class is invalid.|