API Reference
Vcorp File Transfer API
When you use the API, you have to encrypt the file yourself, and the recipient will have to decrypt it themselves. The API is a temporary endpoint to transfer files, nothing more. If a file is not retrieved after 48 hours, it is destroyed. The API allows 1 GB free per file: yes, it is not huge, we are doing our best to raise this value.
To send a file, you will also have to generate an identifier, which will identify the file. We strongly advise you to use a randomly generated identifier of 64 characters.
The API is meant to be simple and efficient: its responses are conventional HTTP codes.
POST /upload to send chunks, GET /download to retrieve the file.Quickstart
Upload a file in two chunks, finalize it, then download it. Generate a fresh File ID for every file.
# 1. Generate a random File ID (32 bytes = 64 hex characters)
ID=$(openssl rand -hex 32)
# 2. Send the file in one or more chunks (raw bytes, in order)
curl -X POST https://vcorp.app:3000/upload \
-H "idfile: $ID" -H "done: false" --data-binary @part1.bin
curl -X POST https://vcorp.app:3000/upload \
-H "idfile: $ID" -H "done: false" --data-binary @part2.bin
# 3. Finalize the upload (no body)
curl -X POST https://vcorp.app:3000/upload -H "idfile: $ID" -H "done: true"
# 4. Download it — this works once, then the file is deleted
curl https://vcorp.app:3000/download -H "idfile: $ID" -o file.bin
Use --data-binary. -d strips line breaks and -F sends multipart form data — both would corrupt the stored file. The server writes the request body exactly as received.
Base URL & authentication
All requests must use HTTPS. Parameters are passed as HTTP headers, not in the URL or query string. Header names are case-insensitive.
There are no API keys and no accounts. The File ID is the credential: anyone who knows it can download the file (once) or append to an upload that is still in progress. Share it only with your recipient.
File ID
Every file is identified by a client-generated idfile: 1 to 64 letters or digits (0-9, a-z, upper or lower case). Anything else is rejected with 400.
Short names like report work, but anyone can guess them, and a guessed ID is a downloaded file. A File ID of 64 hexadecimal characters from 32 random bytes (below) cannot be guessed, even by brute force. The vcorp.app website always uses one.
const bytes = crypto.getRandomValues(new Uint8Array(32));
const idFile = [...bytes].map(b => b.toString(16).padStart(2, "0")).join("");
// e.g. "16f44785c34081ef81558e9e9b4d60cc1d83c29615f0894afc1272f7209ce350"
Always use a cryptographically secure generator. A 256-bit random ID cannot be guessed, which is what keeps files private without accounts.
Upload lifecycle
A file goes through four states. Each request moves it forward; errors during an upload discard it.
done: false chunk creates the file. Each following chunk is appended.done: true closes the upload. No more chunks can be added.GET /download returns the bytes.Chunks
- The body of each
done: falserequest is appended to the file, in the order the server receives the requests. - Send chunks one at a time per file: wait for the 200 of a chunk before sending the next. A second chunk sent while one is still being received is refused with 404.
- There is no minimum chunk size and no fixed maximum: a chunk can be anything from 0 bytes up to the space left in the file (1 GiB in total). The server streams chunks to disk, so large chunks do not use server memory.
- Different files can be uploaded in parallel (up to 100 chunks server-wide at the same time).
- A failed chunk cancels the whole upload. If a chunk is interrupted or rejected while being written (413, 507, 500, connection lost), all data received for this File ID is deleted. Start again from the first chunk; you can reuse the same File ID.
One-time download
A finalized file is deleted as soon as it has been sent successfully once. Any later request for the same File ID returns 404.
If a download is interrupted (connection lost, client closed), the file is kept and can be downloaded again.
Range requests are answered with 206, and any successful response counts as the download: the file is deleted afterwards, even if only part of it was requested. Always download the whole file in a single request.
Downloads are not locked: two requests made at exactly the same moment for the same File ID may both receive the file.
Expiration
| State | Deleted after |
|---|---|
| Upload in progress (not finalized) | 10 minutes without a new chunk |
| Finalized, not downloaded | 48 hours after its last chunk was written |
Expired files are removed by a cleanup that runs every minute, so deletion can happen up to about one minute after the deadline. An expired File ID behaves exactly like one that never existed.
Upload a chunk
Appends a chunk to a file (done: false) or finalizes it (done: true).
Request headers
| Header | Value | Description |
|---|---|---|
idfile required | 1–64 letters or digits | The File ID. |
done required | false or true | false: the body is a chunk to append.true: finalize the file. Must be exactly one of these two lowercase strings. |
Request body
With done: false: the raw bytes of the chunk. Any Content-Type is accepted and ignored; the body is stored as-is. With done: true: no body (ignored if present).
Responses
The response body is always the plain-text status name (for example OK, Bad Request). Checks happen in the order below; the first one that fails decides the response.
| Status | When | Your data |
|---|---|---|
| 400 | idfile is missing or not 1–64 letters or digits. | untouched |
| 400 | A finalized file with this File ID already exists (not downloaded or expired yet). | untouched |
| 404 | Another chunk for this File ID is still being received, or the file is being cleaned up at this instant. Wait for the previous request to finish, then retry. | untouched |
| 503 | 100 chunks are already being received server-wide. Retry later. | untouched |
| 507 | done: false on a new file while 10,000 files are already stored. | nothing created |
| 413 | done: false and this chunk would make the file larger than 1 GiB. The request is cut off as soon as the limit is crossed. | upload deleted |
| 507 | done: false and this chunk would push total server storage over 10 GiB. | upload deleted |
| 400 | done: true but no upload exists for this File ID (no chunk was ever sent, or it expired). | nothing created |
| 500 | done is missing or is neither true nor false. | untouched |
| 500 | The chunk could not be written (connection lost mid-chunk, disk error). | upload deleted |
| 200 | done: false: chunk appended. done: true: file finalized and ready to download. | — |
A chunk with an empty body is accepted and creates an empty upload. Finalizing it produces an empty file. Only finalizing an ID that has no upload at all is refused.
Download a file
Returns the raw bytes of a finalized file, then deletes it.
Request headers
| Header | Value | Description |
|---|---|---|
idfile required | 1–64 letters or digits | The File ID. |
Response headers
| Header | Value |
|---|---|
Content-Type | application/octet-stream |
Content-Length | Size of the file in bytes. Use it for progress bars, or to warn the user before downloading a large file. |
Responses
| Status | When |
|---|---|
| 200 | The body is the file. Once fully sent, the file is deleted from the server. |
| 429 | Your IP sent another download request less than 500 ms ago. Wait a moment, then retry. Checked first. |
| 400 | idfile is missing or not 1–64 letters or digits. |
| 404 | No finalized file for this ID: it never existed, its upload is not finalized yet, it expired, or it was already downloaded. |
| 206 | Only if you send a Range header — see One-time download. Avoid it. |
If an error happens after the transfer has started, the connection is closed without a status code. The file is kept and can be downloaded again.
CORS preflight
Browsers send this automatically before POST /upload and GET /download, because both use custom headers. Any path answers 204 with the CORS headers. You never need to call it yourself.
Any other route (for example GET /) returns 404 with a small HTML error page.
Status codes
| Status | Endpoint | Meaning |
|---|---|---|
| 200 | upload, download | Success. |
| 204 | OPTIONS | CORS preflight accepted. |
| 206 | download | Partial content (Range request). Consumes the file. |
| 400 | upload, download | Invalid File ID; file already finalized; or finalizing an upload that does not exist. |
| 404 | upload | A chunk for this File ID is already in progress. |
| 404 | download | No file to download for this File ID. |
| 413 | upload | File larger than 1 GiB. Upload deleted. |
| 429 | download | More than one download request per IP every 500 ms. Retry after a short wait. |
| 500 | upload | Invalid done header, or the chunk could not be written (upload deleted). |
| 503 | upload | Too many chunks being received at the same time. Retry later. |
| 507 | upload | Server storage full (10 GiB or 10,000 files). |
Limits
| Limit | Value | Exceeded |
|---|---|---|
| File size (sum of all chunks) | 1 GiB — 1,073,741,824 bytes | 413 |
| Chunk size | Up to the space left in the file | 413 |
| Total storage on the server | 10 GiB | 507 |
| Files stored on the server | 10,000 | 507 |
| Chunks received at the same time | 1 per file, 100 server-wide | 404 / 503 |
| Downloads per file | 1 | 404 |
| Download requests per IP | 1 every 500 ms | 429 |
| Unfinished upload lifetime | 10 minutes without a chunk | deleted |
| Finalized file lifetime | 48 hours | deleted |
Sizes are counted on the bytes actually received, never on the Content-Length header.
Timeouts & connections
These limits act on the connection itself: when they trigger, the connection is closed and no HTTP status is returned.
| Rule | Value |
|---|---|
| Inactivity | A connection that sends and receives nothing for 30 seconds is closed. |
| Request headers | Must be fully received within 10 seconds. |
| TLS handshake | Must complete within 10 seconds. |
| Request duration | No limit. A slow but steady 1 GiB chunk is fine as long as bytes keep flowing. |
| Open connections | At most 500 at the same time; extra connections are refused. |
CORS
The API can be called from any web page. Every response carries:
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST
Access-Control-Allow-Headers: idfile, done
No cookies or credentials are used. Content-Length is readable from JavaScript on download responses.
Error handling
| You get | What to do |
|---|---|
| 404 on upload | A previous chunk for this file is still in flight. Wait for it to finish, then resend the same chunk. |
| 503 | Server busy. Resend the same chunk after a short delay (for example 1 s, 2 s, 4 s…). Your upload is intact. |
| 507 | Server full. If it was a new file, nothing was stored; if it was a later chunk, the upload was deleted. Try again later. |
| 413 | The file exceeds 1 GiB. The upload was deleted. |
| 500 / network error during a chunk | The upload was deleted. Restart from the first chunk. |
400 on done: true | The upload no longer exists (expired or deleted after an error). Restart from the first chunk. |
| 404 on download | Nothing to download: wrong ID, upload not finalized, expired, or already downloaded. |
| 429 on download | Too fast: wait 500 ms between two download requests from the same IP, then retry. |
Browser example
Upload a Blob chunk by chunk, then finalize. Each chunk waits for the previous one, as required.
const API = "https://vcorp.app:3000";
const CHUNK_SIZE = 8 * 1024 * 1024; // 8 MiB
async function upload(blob, idFile) {
for (let offset = 0; offset < blob.size; offset += CHUNK_SIZE) {
const res = await fetch(`${API}/upload`, {
method: "POST",
headers: { idfile: idFile, done: "false" },
body: blob.slice(offset, offset + CHUNK_SIZE),
});
if (!res.ok) throw new Error(`Chunk failed: ${res.status}`);
}
const res = await fetch(`${API}/upload`, {
method: "POST",
headers: { idfile: idFile, done: "true" },
});
if (!res.ok) throw new Error(`Finalize failed: ${res.status}`);
}
Download it, writing straight to disk when the browser supports showSaveFilePicker, and through memory otherwise.
// Call from a click handler
async function download(idFile) {
// Chromium desktop: ask where to save first — the picker must open
// right after the user's click, before any network request
const handle = "showSaveFilePicker" in window
? await showSaveFilePicker({ suggestedName: "file.bin" })
: null;
const res = await fetch(`${API}/download`, { headers: { idfile: idFile } });
if (!res.ok) throw new Error(`Download failed: ${res.status}`);
if (handle) {
// Streamed straight to disk: no memory used, whatever the size
await res.body.pipeTo(await handle.createWritable());
} else {
// Other browsers: the whole file goes through memory
// (its size is in the Content-Length header, to warn the user first)
const blob = await new Response(res.body).blob();
const a = Object.assign(document.createElement("a"), {
href: URL.createObjectURL(blob), download: "file.bin",
});
a.click();
setTimeout(() => URL.revokeObjectURL(a.href), 60_000);
}
}
In a real client, decrypt the stream between res.body and the destination. The format used by vcorp.app is described in Web client format.
Web client format
How the vcorp.app website uses this API. Follow it to build a compatible client, or to check what the site does (open DevTools while sending a file).
- Key. 32 random bytes, generated in the browser. It is put after the
#of the link, encoded in base64url. The link holds the File ID and the key after the#:https://vcorp.app/#<file ID>.<key>. When the link is opened, the part after the#is not sent with the request for the page: it stays in the browser. The page then sends only the File ID to the API, never the key. - File ID.
idfile= 32 other random bytes, in hexadecimal (64 characters), drawn separately from the key: the File ID tells nothing about the key. The server only ever sees the File ID. - Header part. The first chunk is a JSON object
{"name", "type"}padded with spaces to 1,024 bytes, then encrypted. The file name never reaches the server in clear, and its length is hidden. - Data parts. The file is read as a stream and sent in parts of 4 MiB, each as its own chunk. The last part is the one with nothing after it: it can be shorter, or empty for an empty file. The whole file is never loaded in memory.
- Several files. They are put in a zip (deflate) built as a stream in the browser, named
vcorp-files.zip, and sent as one file. - Encryption. Each part is encrypted with AES-256-GCM: IV = 12 bytes, all zero except the part number (0 for the header, then 1, 2…) as a big-endian 32-bit integer in the last 4 bytes; additional data = 1 byte,
1on the last data part and0otherwise. Each encrypted part is 16 bytes longer than the original.
The key is unique per file, so an IV is never reused. Because each part carries its number and the last one is marked, a part that is changed, moved, removed or added makes decryption fail.
Security model
- Zero knowledge. Files are meant to be encrypted in the browser before upload. The server stores opaque bytes under a random ID, with a
.binextension — never a file name, type or key. - The File ID is a secret. Whoever holds it can download the file once, or append to an unfinished upload. Integrity must be ensured by the client's encryption (use an authenticated mode such as AES-GCM so any modification is detected).
- Short-lived storage. Files are deleted after one download, after 48 hours, or after 10 minutes if the upload is abandoned.
- Anti-probing. Each IP can send one download request every 500 ms, which makes guessing IDs slow. IPs are only kept in memory, for 500 ms, and never logged.
- No accounts, no cookies. Requests carry nothing but the File ID.
- Transport. All traffic goes over HTTPS.