SShortSingh.
Back to feed

How to Build Resumable S3 Multipart Uploads in Next.js Without Overloading Your Server

0
·1 views

A developer guide published on DEV Community outlines a three-step pattern for handling large file uploads in Next.js App Router without routing file bytes through the server. The approach uses AWS S3 multipart uploads combined with presigned URLs, so the browser uploads file chunks directly to S3 while the Next.js Route Handler only processes metadata and enforces validation policies. Files are split into 5–10MB chunks on the client side, uploaded via XMLHttpRequest to enable real-time progress tracking, and limited to 3–6 concurrent transfers to avoid network strain. Each successfully uploaded part's ETag and part number must be recorded — ideally in IndexedDB — to support resumable uploads after interruptions or page refreshes. The server finalizes the multipart upload only after all parts are confirmed, keeping memory usage low and making the solution suitable for serverless hosting environments.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Developer builds HTTP 402 reverse proxy to charge AI agents per API call

A developer has released x402-micro-tollgate, an open-source Express-based tool that acts as both an HTTP 402 reverse proxy and an MCP server. The project was built to enable per-call payments for existing HTTP APIs without distributing API keys. Ungated routes return a 402 Payment Required response, and requests are only forwarded to the upstream URL after payment is settled. The tool also exposes MCP tools, with some available for free and others requiring payment. It can be self-hosted via npx and is available on both GitHub and npm.

0
ProgrammingDEV Community ·

Aviation Mechanic's 80-Year Career Sparks Dev Community Talk on Maintenance Culture

A human-interest article about an aviation mechanic with an 80-year career gained traction on a developer community platform, accumulating 47 points and 13 comments. Although it is not a tool or software library, it resonated with developers because it reflects engineering values such as procedural discipline, long feedback loops, and institutional knowledge preservation. The discussion highlights how reliable systems are sustained through careful documentation and consistent maintenance rather than dramatic overhauls. Key takeaways for developers include recording the reasoning behind fixes, treating maintenance as first-class engineering work, and ensuring handoffs do not depend solely on a single expert's memory. The post serves as a reminder that lessons from high-stakes physical systems like aviation can offer meaningful parallels for software reliability practices.

0
ProgrammingDEV Community ·

How a React Native app handles offline edits with a self-undoing queue

A developer has detailed the offline write architecture behind a notes-and-lists app built with React Native 0.81 and a single Kotlin module. The app treats the server as the sole source of truth, with the phone holding a read-only cache used only when the network is unavailable. When a user edits or deletes an item offline, the change is stored in a durable JSON queue in AsyncStorage, complete with a rollback payload capturing the pre-edit state so changes can be reversed if the server later rejects them. The queue replays on two triggers and distinguishes retryable network failures from definitive server refusals like 400 or 409 errors, which are surfaced to the user immediately. An earlier rule blocking offline edits to shared cards was ultimately removed as the design matured.

0
ProgrammingDEV Community ·

Developer Builds Lightweight Kafka Clone in Go to Decode Its Inner Workings

A software developer created 'kafka-lite', a stripped-down Kafka-inspired message broker, to gain a deeper understanding of how Apache Kafka works under the hood. The project, written in Go, uses TCP for communication and file I/O for persistence, deliberately avoiding embedded databases to expose the raw storage layer. Development was broken into five stages covering core features such as persistent logs, log segmentation, consumer groups, multi-broker replication, and a Python client SDK. Rather than replicating Kafka's binary protocol, the developer opted for a simpler length-prefixed JSON framing approach to keep complexity manageable. The project is shared openly on GitHub and is explicitly not intended as a production replacement for Kafka, but as a learning exercise in distributed systems design.