Secure Image Uploads
in Next.js with Cloudinary
Public (unsigned) upload presets are fine for quick prototypes — but real apps need to prove they own the upload request. This demo shows you how to generate a server-side signature so your API Secret never reaches the browser.
Signed Uploads
Generate a SHA-256 signature on the server. Cloudinary verifies it before accepting any file.
API Route Pattern
A single Next.js Route Handler (/api/sign) is the only place your API Secret is used.
Real-world Ready
Drop this pattern into production. Extend the route to add auth checks, rate limiting, or folder routing.
Quick Setup (3 steps)
- 1Copy
.env.local.exampleto.env.localand fill in your Cloudinary cloud name, API key, and API secret from the Cloudinary console. - 2Run
npm run devand open this page in your browser. - 3Click the upload zone below, pick an image, and watch the secure flow in action. Open your browser's Network tab to see the
POST /api/signrequest before the upload fires.
Upload an Image
Signed · API Secret never reaches the browser
/api/sign generates a SHA-256 signature server-side before every upload
Gallery