This folder is empty
Upload files or create a folder to get started| Name | Size | Modified | Actions |
|---|
Drop files to upload
API Keys
Create and manage API keys for external uploads to your CDN.
No API Keys
Create a key to start uploading externally.Usage Guide
Integrate CDNKit uploads into your app using the external API.
Authentication
All requests require X-ORBLINNCDN-TOKEN and X-ORBLINNCDN-SECRET headers. Your API key is automatically scoped to its assigned cluster.
Upload a Single File
Send a POST request with the file as multipart/form-data. Optionally specify a folder to organize uploads.
curl -X POST https://cdnkit.orblinn.com/api/external.php \ -H "X-ORBLINNCDN-TOKEN: ocdn_your_token_here" \ -H "X-ORBLINNCDN-SECRET: ocdns_your_secret_here" \ -F "file=@./my-image.png" \ -F "folder=uploads/images"
Upload Multiple Files
Use the files[] field name to upload multiple files in a single request.
curl -X POST https://cdnkit.orblinn.com/api/external.php \ -H "X-ORBLINNCDN-TOKEN: ocdn_your_token_here" \ -H "X-ORBLINNCDN-SECRET: ocdns_your_secret_here" \ -F "files[]=@./photo1.jpg" \ -F "files[]=@./photo2.jpg" \ -F "folder=gallery"
Response
On success, you'll receive a JSON response with the CDN URL for each uploaded file.
{
"success": true,
"uploaded": [
{
"name": "my-image.png",
"path": "job/uploads/images/my-image.png",
"size": 245760,
"sizeFormatted": "240 KB",
"url": "https://cdn.orblinn.com/job/uploads/images/my-image.png"
}
],
"data": { ... },
"errors": []
}
Create a Server-Side API Route
Never expose your API secret on the client. Create a Next.js API route that proxies uploads to CDNKit. Store ORBLINNCDN_TOKEN and ORBLINNCDN_SECRET in your .env.
import { NextResponse } from 'next/server';
export async function POST(request: Request) {
try {
const formData = await request.formData();
const files = formData.getAll('file');
if (!files || files.length === 0) {
return NextResponse.json({ error: 'No files provided' }, { status: 400 });
}
const cdnFormData = new FormData();
files.forEach(file => cdnFormData.append('files[]', file));
// Optional: specify a subfolder within the cluster
const folder = formData.get('folder');
if (folder) cdnFormData.append('folder', folder as string);
const response = await fetch(
'https://cdnkit.orblinn.com/api/external.php',
{
method: 'POST',
headers: {
'X-ORBLINNCDN-TOKEN': process.env.ORBLINNCDN_TOKEN!,
'X-ORBLINNCDN-SECRET': process.env.ORBLINNCDN_SECRET!,
},
body: cdnFormData,
}
);
const data = await response.json();
if (!response.ok) {
return NextResponse.json(
{ error: data.error || 'Upload failed' },
{ status: response.status }
);
}
return NextResponse.json({
success: true,
file: data.data,
files: data.uploaded,
errors: data.errors,
});
} catch (error: any) {
return NextResponse.json(
{ error: error.message || 'Internal server error' },
{ status: 500 }
);
}
}
Client-Side Upload Component
Call your proxy API route from a React component. Files are sent from the browser → your server → CDNKit.
import { useState, useRef } from 'react';
export default function FileUpload({ folder = '' }) {
const [uploading, setUploading] = useState(false);
const [result, setResult] = useState(null);
const inputRef = useRef<HTMLInputElement>(null);
const handleUpload = async (e: React.ChangeEvent<HTMLInputElement>) => {
const file = e.target.files?.[0];
if (!file) return;
setUploading(true);
const formData = new FormData();
formData.append('file', file);
if (folder) formData.append('folder', folder);
try {
const res = await fetch('/api/upload', {
method: 'POST',
body: formData,
});
const data = await res.json();
if (!res.ok) throw new Error(data.error);
setResult(data);
} catch (err) {
console.error('Upload failed:', err);
} finally {
setUploading(false);
}
};
return (
<div>
<input
type="file"
ref={inputRef}
onChange={handleUpload}
disabled={uploading}
/>
{uploading && <p>Uploading...</p>}
{result && <p>Uploaded: {result.file?.url}</p>}
</div>
);
}
Environment Variables
Add your credentials to .env — never commit this file.
ORBLINNCDN_TOKEN="ocdn_your_token_here" ORBLINNCDN_SECRET="ocdns_your_secret_here"
Performance Center
Overview of your CDNKit storage and asset usage.
Total Storage
Total Assets
Total Folders
System Status
Usage trend Last 30 days
Trash Bin
Deleted files are kept here until permanently removed.