Loading...
Loading...
Upload files to ImageKit from a publicly accessible URL. Use when: uploading images, videos, or files to ImageKit media library; specifying folder paths; setting file names, tags, or metadata during upload. NOTE: only URL-based uploads are supported — local file paths cannot be passed.
npx skill4agent add imagekit-developer/skills upload-filesfilefilefileNameclient.files.upload()mcp_imagekit_api_executeasync function run(client) {
const file = await client.files.upload({
file: 'https://example.com/photo.jpg', // URL string ONLY — no local paths
fileName: 'photo.jpg',
folder: '/products',
tags: ['product', 'featured'],
});
return { fileId: file.fileId, url: file.url, size: file.size, fileType: file.fileType };
}FileUploadV1| Parameter | Description |
|---|---|
| Publicly accessible URL of the file to upload. Local paths are NOT allowed. |
| Name for the uploaded file, e.g. |
| Destination folder in ImageKit (default: |
| Array of tags (e.g. |
| Mark file as private |
| Publish the file; |
| Add a unique suffix to the filename (default |
| Overwrite an existing file at the same path |
| Overwrite existing AITags when replacing |
| Overwrite existing tags when replacing |
| Overwrite existing customMetadata when replacing |
| Description for the file |
| Important area: |
| Object of custom metadata, e.g. |
| Array of extensions, e.g. |
| Object of pre/post transformations, e.g. |
| URL to receive extension completion status |
| Fields to include in the response (e.g. |
| Server-side upload check expression |
// Basic upload to a folder with tags
await client.files.upload({
file: 'https://example.com/photo.jpg',
fileName: 'photo.jpg',
folder: '/products',
tags: ['product', 'featured'],
});
// Overwrite an exact-named file
await client.files.upload({
file: 'https://example.com/banner.jpg',
fileName: 'banner.jpg',
useUniqueFileName: false,
overwriteFile: true,
});
// Upload with auto-tagging extension
await client.files.upload({
file: 'https://example.com/photo.jpg',
fileName: 'photo.jpg',
extensions: [{ name: 'google-auto-tagging', maxTags: 5 }],
});
// Upload with custom metadata and a pre-transformation
await client.files.upload({
file: 'https://example.com/photo.jpg',
fileName: 'photo.jpg',
customMetadata: { brand: 'Nike' },
transformation: { pre: 'w-1200,q-80' },
});folder/fileNamea-zA-Z0-9.-_useUniqueFileNametrueuseUniqueFileName: falseoverwriteFile: truecustomMetadatamcp_imagekit_api_executeclient.files.upload()fileIdurlsizefileTypefileTypeimagenon-image