How to Upload Files to X02
A complete, easy-to-follow guide to uploading files on X02. Start with simple browser drag-and-drop and clipboard pasting, then explore developer workflows using cURL, REST APIs, MCP, and desktop tools.
By X02 Team · · Tutorial, Uploads, API, MCP, Developer Tools, Beginners
Sharing files on the internet shouldn't require creating complex accounts, waiting through countdown timers, or navigating ad-filled download pages. X02 is built to do one thing exceptionally well: host your files securely and give you an instant, blazing-fast direct link you can share anywhere.
Whether you're quickly sharing a screenshot with a friend on Discord or automating build artifact uploads across continuous integration (CI/CD) pipelines, X02 supports a variety of upload methods.
[!TIP] Quick Navigation:
Part 1: The Easy Guide (For Everyone)
You don't need to write code or configure complex software to use X02. Here are the fastest ways to share files right from your browser.
1. Drag-and-Drop in Your Web Browser
| Where to Go | Direct Link | Action |
|---|---|---|
Homepage |
Open x02.me | Drag any file into the dropzone |
- Open x02.me in your browser.
- Drag your image, video, document, or archive file from your computer and drop it into the upload box.
- Your file uploads instantly, and your direct shareable link (
https://x02.me/i/yourfile.png) is copied straight to your clipboard.
2. Paste Directly from Your Clipboard (Ctrl + V / Cmd + V)
If you take a screenshot using your system's built-in snipping tool (like Win + Shift + S on Windows or Cmd + Shift + 4 on macOS), you don't even need to save the file to your computer first:
- Copy or capture any image to your clipboard.
- Open x02.me.
- Press
Ctrl + V(orCmd + Von Mac). - The image will upload immediately and return your direct link.
[!TIP] Clipboard Snipping Pro-Tip: You don't have to click on the upload box first—just press
Ctrl + Vanywhere on the page!
3. Setting Auto-Expiring (Self-Destructing) Links
Sometimes you need to share a file temporarily—like a sensitive document, a short-lived bug screenshot, or a private draft—and you don't want it lingering on the web forever.
Before dropping or selecting your file, use the Expiry Selector dropdown:
| Expiry Option | What Happens | Best For |
|---|---|---|
| Never (Default) | File stays hosted permanently | Public screenshots, website assets, portfolio items |
| 1 Hour | Auto-deleted after 60 minutes | One-off sensitive snippets, short discussions |
| 6 Hours | Auto-deleted after 6 hours | Daily work handoffs, temporary review proofs |
| 1 Day (24h) | Auto-deleted after 24 hours | Bug reports, temporary test builds |
| 7 Days | Auto-deleted after 1 week | Weekly collaboration drafts |
| 30 Days | Auto-deleted after 1 month | Monthly invoice previews, temporary project files |
4. Upload Limits & Supported File Types
| User Tier | Max File Size | Hourly Limit | Account Benefits |
|---|---|---|---|
| Anonymous (No Login) | 50 MB | 30 uploads / hour | Instant sharing, auto-expiry options |
| Registered (Free Account) | 300 MB | Custom / High Limit | Personal dashboard, custom subdomain, folders, file management |
Supported Formats:
- Images: JPEG (
.jpg), PNG (.png), GIF (.gif), WebP (.webp), AVIF (.avif), SVG (.svg), BMP (.bmp) - Videos: MP4 (
.mp4), WebM (.webm), MOV (.mov), MKV (.mkv), AVI (.avi) - Audio: MP3 (
.mp3), WAV (.wav), FLAC (.flac), OGG (.ogg), M4A (.m4a) - Documents & Archives: PDF (
.pdf), Word (.docx), Excel (.xlsx), Text (.txt), ZIP (.zip), RAR (.rar), 7z (.7z)
Part 2: The Developer & Power User Guide
For engineers, automation pipelines, and AI assistants, X02 provides a high-throughput REST API, an MCP server, and desktop integration endpoints.
1. Uploading via cURL (Terminal)
You can send files to X02 directly from your command line using curl:
Anonymous Upload (Single Command)
curl -X POST "https://x02.me/api/upload" \
-F "[email protected]"
Authenticated Upload with Expiration
If you have an account, generate an API key in your Dashboard Settings to associate uploads with your user account:
curl -X POST "https://x02.me/api/upload" \
-H "x-api-key: YOUR_X02_API_KEY" \
-F "[email protected]" \
-F "expiry=1d"
Requesting Structured JSON Output
By default, X02 returns a raw plaintext URL string. If you are building a tool or script, send the Accept: application/json header to receive a structured JSON object:
curl -X POST "https://x02.me/api/upload" \
-H "x-api-key: YOUR_X02_API_KEY" \
-H "Accept: application/json" \
-F "[email protected]"
Response Payload:
{
"success": true,
"url": "https://x02.me/i/K8j2Pq.png",
"filename": "K8j2Pq.png",
"size": 248102,
"mimeType": "image/png",
"expiry": "1d",
"deleteUrl": "https://x02.me/api/user/images/K8j2Pq.png/delete"
}
2. Uploading in JavaScript / TypeScript (Node.js & Browser)
Here is a modern fetch implementation uploading a file via standard FormData:
import fs from "fs";
async function uploadToX02(filePath: string, apiKey?: string): Promise<string> {
const formData = new FormData();
const fileBlob = new Blob([fs.readFileSync(filePath)]);
formData.append("file", fileBlob, "sample.png");
formData.append("expiry", "7d"); // Optional: 1h, 6h, 1d, 7d, 30d
const headers: Record<string, string> = {
Accept: "application/json",
};
if (apiKey) {
headers["x-api-key"] = apiKey;
}
const response = await fetch("https://x02.me/api/upload", {
method: "POST",
headers,
body: formData,
});
if (!response.ok) {
const errorText = await response.text();
throw new Error(`Upload failed (${response.status}): ${errorText}`);
}
const data = await response.json();
return data.url; // e.g. https://x02.me/i/AbCdEf.png
}
// Example usage
uploadToX02("./screenshot.png", "YOUR_API_KEY")
.then((url) => console.log("Hosted at:", url))
.catch(console.error);
3. Uploading in Python
A lightweight Python snippet using the requests library:
import requests
def upload_file(file_path: str, api_key: str = None, expiry: str = None) -> str:
url = "https://x02.me/api/upload"
headers = {"Accept": "application/json"}
if api_key:
headers["x-api-key"] = api_key
data = {}
if expiry:
data["expiry"] = expiry
with open(file_path, "rb") as f:
files = {"file": f}
response = requests.post(url, headers=headers, files=files, data=data)
response.raise_for_status()
return response.json().get("url")
# Example usage
hosted_url = upload_file("debug-log.txt", api_key="YOUR_API_KEY", expiry="1d")
print("Direct URL:", hosted_url)
4. Uploading Remote URLs Directly (/api/upload/url)
If you want X02 to fetch and host a file from an existing internet URL without downloading it to your local machine first, use the remote URL ingestion endpoint:
curl -X POST "https://x02.me/api/upload/url" \
-H "x-api-key: YOUR_X02_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/external-graphic.png",
"expiry": "30d"
}'
5. Let an AI Assistant Upload for You (MCP)
X02 runs a Model Context Protocol server, so AI coding assistants and chat clients can upload and manage files on your account directly. You sign in once in the browser and approve what the app is allowed to do — your API key is never pasted into the client.
# Claude Code
claude mcp add --transport http x02 https://up.x02.me/mcp
# Any other MCP client (Claude Desktop, Cursor, Windsurf): use this URL
https://up.x02.me/mcp
Once connected, you can just ask:
"Upload this screenshot to X02 and give me the link." "Move last week's uploads into a folder called Archive."
The server exposes twelve tools covering uploads, search, renaming, moving, deleting, and folder sharing. Access is scoped — an app that only asked to read your files cannot delete them — and you can disconnect any client without rotating your API key.
[!NOTE]
upload_filesends bytes base64-encoded inside the tool call, so it only suits genuinely small files — an ordinary screenshot becomes ~200,000 characters and most assistants will not emit that. Useupload_from_urlwhen the file is already online, or upload it here and hand the assistant the link.
6. Desktop Screen Capture Integration (ShareX & Flameshot)
You can connect desktop screenshot tools so that pressing your hotkey instantly captures a screen region, uploads it to X02, and puts the link in your clipboard:
- ShareX (Windows): Download your pre-configured
.sxcufile from your Dashboard -> Settings -> Integrations and double-click to install. - Flameshot (Linux / macOS): Point your post-capture script at the upload endpoint —
curl -s -H "x-api-key: YOUR_API_KEY" -F "file=@$1" https://up.x02.me/api/upload | xclip -selection clipboard.
Next Steps & Related Tutorials
| What to learn next | Guide Link |
|---|---|
| Set up 1-second desktop screenshot hotkeys | How to Integrate ShareX with X02 |
| Organize your uploads into folders | How to Organize Files with Folders |
| Update or replace files without breaking links | How to Replace a File Without Changing Its Link |
| Give your uploads clean custom names | How to Rename Your Uploaded Files |