Upload: modify
Re upload image with modifications. The original image will be removed, the newly uploaded and modified image will have the same public ID, as the original image.
Request
HTTP request
PUT /upload/v1/c/<cloudId>/o/<publicId>/modify HTTP/1.1
or
PATCH /upload/v1/c/<cloudId>/o/<publicId>/modify HTTP/1.1
Parameters
Paramete name | Value | Description |
---|---|---|
Path parameters | ||
cloudId | string | Cloud ID where you upload the image. |
publicId | string | Public ID of the image. |
Optional query parameters | ||
projection | string | Projection settings; comma separated string see |
Request Body
Property name | Value | Description | Note |
---|---|---|---|
Required Properties | |||
file | binary | Binary content of the file | |
Optional Properties | |||
transformation | string | Transformations on the image, affect the image before storing to the cloud | |
format | string | Image format to be stored | |
plugins | string | Plugins; comma separated string | |
tags | string[] | Tags for the image |
Response
If successful, this method returns a image resource in the response body.
Response HTTP status code
HTTP status code | Description |
---|---|
200 | Successfully modified and re uploaded |
For more information about HTTP codes, click here.
Rate limit
Detailed information for image rate limitation is available on Shardimage developers.
SDK
use shardimage\shardimagephp\auth\Client;
use shardimage\shardimagephp\factories\Transformation;
$client = new Client([
'apiKey' => '<apiKey>',
'apiSecret' => '<apiSecret>',
'imageSecret' => '<imageSecret>',
]);
$params = [
'publicId' => '<publicId>',
'cloudId' => '<cloudId>'
];
$transformations = new Transformation();
$transformations->toBmp();
$transformations->flipVerticalAndHorizontal();
$optParams = [ // Optional parameters
'transformation' => $transformations
'tags' => ['newTag'],
];
$response = $client->getUploadService()->modify($params, $optParams);