Move file
post
https://api.imagekit.io
/v1/files/move
Move file API
In case of an error, you will get an error code along with the error message. On success, you will receive a
204
status code with an empty body.Here is the example request to understand the API usage.
cURL
Node.js
Python
PHP
Java
Ruby
Go
.Net
curl -X POST "https://api.imagekit.io/v1/files/move" \
-H 'Content-Type: application/json' \
-u your_private_key: -d '
{
"sourceFilePath" : "/path/to/file.jpg",
"destinationPath" : "/folder/to/move/into/"
}
'
var ImageKit = require("imagekit");
var imagekit = new ImageKit({
publicKey : "your_public_api_key",
privateKey : "your_private_api_key",
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});
imagekit.moveFile({
sourceFilePath: "/path/to/file.jpg",
destinationPath: "/folder/to/move/into/"
}, function(error, result) {
if(error) console.log(error);
else console.log(result);
});
from imagekitio import ImageKit
imagekit = ImageKit(
public_key='your_public_api_key',
private_key='your_private_api_key',
url_endpoint = 'https://ik.imagekit.io/your_imagekit_id/'
)
move_file = imagekit.move_file(options=MoveFileRequestOptions(source_file_path="/file.jpg",
destination_path="/test"))
print("Move file-", move_file, end="\n\n")
# Raw Response
print(move_file.response_metadata.raw)
use ImageKit\ImageKit;
$public_key = "your_public_api_key";
$your_private_key = "your_private_api_key";
$url_end_point = "https://ik.imagekit.io/your_imagekit_id";
$imageKit = new ImageKit(
$public_key,
$your_private_key,
$url_end_point
);
$sourceFilePath = '/path/to/file.jpg';
$destinationPath = '/folder/to/move/into/';
$moveFile = $imageKit->move([
'sourceFilePath' => $sourceFilePath,
'destinationPath' => $destinationPath
]);
echo("Move File : " . json_encode($moveFile));
MoveFileRequest moveFileRequest = new MoveFileRequest();
moveFileRequest.setSourceFilePath("/path/to/file.jpg");
moveFileRequest.setDestinationPath("/folder/to/move/into/");
ResultNoContent resultNoContent = ImageKit.getInstance().moveFile(moveFileRequest);
imagekitio = ImageKitIo::Client.new("your_private_key", "your_public_key", "your_url_endpoint")
imagekitio.move_file(
source_file_path: '/path/to/file.jpg',
destination_path: '/folder/to/move/into/'
)
resp, err := ik.Media.MoveFile(ctx, media.MoveFileParam{
SourcePath: "/path/to/file.jpg",
DestinationPath: "/folder/to/move/into/",
})
var imagekit = new ImageKit({
publicKey : "your_public_api_key",
privateKey : "your_private_api_key",
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/"
});
MoveFileRequest moveFile = new MoveFileRequest
{
sourceFilePath = "/path/to/file.jpg",
destinationPath = "/folder/to/copy/into/"
};
ResultNoContent resultNoContentMoveFile = imagekit.MoveFile(moveFile);
Last modified 6mo ago