Skip to content

Uploadista Server

The Uploadista Server is your single entry point for file uploads and processing. It combines:

  • Upload Engine - Handles file uploads, chunking, and resumability
  • Flows Engine - Processes files (resize, optimize, transform)
  • Plugins - Add capabilities like image processing, virus scanning
  • Framework Adapters - Connect to Hono, Express, or Fastify

You create one server instance with createUploadistaServer(), configure it once, and it handles everything.

import { createUploadistaServer } from "@uploadista/server";
import { s3Store } from "@uploadista/data-store-s3";
import { redisKvStore } from "@uploadista/kv-store-redis";
import { honoAdapter } from "@uploadista/adapters-hono";
const uploadista = await createUploadistaServer({
// Where files are stored (required)
dataStore: s3Store({
deliveryUrl: "https://cdn.example.com",
s3ClientConfig: { bucket: "uploads", region: "us-east-1" },
}),
// Where metadata is stored (required)
kvStore: redisKvStore({ redis }),
// Framework adapter (required)
adapter: honoAdapter(),
});
// Returns:
// - uploadista.handler → HTTP request handler
// - uploadista.websocketHandler → WebSocket handler for progress
// - uploadista.dispose → Cleanup function
OptionTypeDescription
dataStoreDataStoreWhere file content is stored. See Data Stores.
kvStoreKvStoreWhere upload metadata is stored. See KV Stores.
adapterAdapterFramework adapter (Hono, Express, or Fastify).
OptionTypeDefaultDescription
flowsFlowProvider-Flow definitions for file processing.
pluginsPlugin[][]Processing plugins (image, video, etc.).
eventBroadcasterEventBroadcasterMemoryFor multi-server setups, use Redis.
withTracingbooleanfalseEnable OpenTelemetry tracing.
observabilityLayerLayer-Custom observability configuration.
import { createUploadistaServer } from "@uploadista/server";
import { s3Store } from "@uploadista/data-store-s3";
import { redisKvStore } from "@uploadista/kv-store-redis";
import { redisEventBroadcaster } from "@uploadista/event-broadcaster-redis";
import { imagePlugin } from "@uploadista/flow-images-sharp";
import { honoAdapter } from "@uploadista/adapters-hono";
const uploadista = await createUploadistaServer({
// Storage
dataStore: s3Store({ /* ... */ }),
kvStore: redisKvStore({ redis }),
// Multi-server event broadcasting
eventBroadcaster: redisEventBroadcaster({
redis: redisPublisher,
subscriberRedis: redisSubscriber,
}),
// File processing
flows: getFlowById,
plugins: [imagePlugin],
// Observability
withTracing: true,
// Framework
adapter: honoAdapter(),
});

The Uploadista Server works with popular Node.js and edge frameworks. Choose based on your deployment:

FrameworkBest ForDeployment
HonoEdge, Cloudflare WorkersCloudflare, Deno, Bun
ExpressTraditional Node.jsAWS, GCP, Azure, self-hosted
FastifyHigh-performance Node.jsAWS, GCP, Azure, self-hosted
import { Hono } from "hono";
import { upgradeWebSocket } from "hono/cloudflare-workers";
const app = new Hono();
// HTTP routes for uploads and flows
app.on(
["HEAD", "POST", "GET", "PATCH", "DELETE"],
["/uploadista/api/*"],
(c) => uploadista.handler(c)
);
// WebSocket for progress updates
app.get(
"/uploadista/ws/upload/:uploadId",
upgradeWebSocket(uploadista.websocketHandler)
);

Use our official client libraries for the best experience with uploads, progress tracking, and error handling:

ClientPlatformFeatures
ReactWebHooks, components, drag-and-drop
VueWebComposables, components
ExpoReact NativeMobile-optimized, background uploads

The official clients handle:

  • Chunked uploads - Automatic file splitting for large files
  • Resumability - Auto-resume on connection failure
  • Progress tracking - WebSocket-based real-time progress
  • Error handling - Retry logic and error recovery
  • TypeScript - Full type safety

The Uploadista Server exposes these HTTP routes:

MethodRouteDescription
POST/uploadista/api/uploadCreate new upload
HEAD/uploadista/api/upload/:idGet upload offset
PATCH/uploadista/api/upload/:idUpload chunk
GET/uploadista/api/upload/:idGet upload status
DELETE/uploadista/api/upload/:idDelete upload
MethodRouteDescription
POST/uploadista/api/flow/:flowId/executeExecute a flow
GET/uploadista/api/flow/job/:jobIdGet job status
DELETE/uploadista/api/flow/job/:jobIdCancel job
RouteDescription
/uploadista/ws/upload/:uploadIdReal-time upload progress

See Upload Engine for details on the upload protocol.

Configure flows to run automatically when uploads complete:

const uploadista = await createUploadistaServer({
// ... other options
flows: async (flowId, clientId) => {
// Return flow definition based on flowId
return getFlowFromDatabase(flowId);
},
});

Or trigger flows manually via API:

Terminal window
POST /uploadista/api/flow/image-processing/execute
{
"uploadId": "upload_abc123"
}

See Flows Engine for more on flow configuration.

Custom HTTP Client (Advanced)

If you’re not using React, Vue, or Expo, you can implement uploads directly using the HTTP API:

async function uploadFile(file) {
// 1. Create upload
const createRes = await fetch("/uploadista/api/upload", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
fileName: file.name,
size: file.size,
type: file.type,
}),
});
const upload = await createRes.json();
// 2. Upload content
await fetch(`/uploadista/api/upload/${upload.id}`, {
method: "PATCH",
headers: {
"Content-Type": "application/offset+octet-stream",
"Upload-Offset": "0",
},
body: file,
});
return upload.id;
}

For resumable uploads, chunking, and progress tracking, see the Upload Engine documentation.

  • Use Redis for KV Store (not Memory) - enables multi-server deployments
  • Use Redis Event Broadcaster for WebSocket events across servers
  • Configure appropriate file size limits
  • Set up authentication middleware
  • Enable tracing for debugging (withTracing: true)
// Add authentication middleware before Uploadista routes
app.use("/uploadista/*", authMiddleware);
// Then mount Uploadista
app.on(["HEAD", "POST", "GET", "PATCH", "DELETE"], ["/uploadista/api/*"],
(c) => uploadista.handler(c)
);

See Authentication for fine-grained access control.

When shutting down your server, dispose of the Uploadista instance:

process.on("SIGTERM", async () => {
await uploadista.dispose();
process.exit(0);
});