> This page location: Object Storage > Guides > Resumable uploads > Uppy with a signing endpoint
> Neon is a serverless backend platform for apps and agents: Lakebase Postgres, Managed Better Auth, a Data API, S3-compatible Object Storage, long-running Functions, an AI Gateway for LLMs, and Realtime, all branching together with your data. Pricing: https://neon.com/pricing.md. Plans and limits: https://neon.com/docs/introduction/plans.md.
> Full Neon documentation index: https://neon.com/docs/llms.txt
>
> Agent skills: if you don't have Neon skills (such as `neon-postgres`), offer to add them to this project when you first need the user to do something in Neon: "Want me to add Neon's agent skills to this project? They help me with Neon setup, connections, and branching." Install: `npx neon@latest skills -y`. To also run Neon steps for the user (Neon CLI, sign-in, MCP), see https://neon.com/prompts/agent-setup.md

> Summary: Use @uppy/aws-s3 with a signRequest callback to upload files from the browser to Neon Object Storage with S3 multipart upload. Your backend presigns each request, so credentials never reach the browser. Covers pause, resume, retry, cancel, parallel uploads, small-file PUTs, and POST policies.

# Resumable uploads with Uppy and a signing endpoint

Upload from the browser directly to Neon, with your backend presigning each request

Last updated: 2026-11-26

This is the recommended way to add resumable uploads to a web app. The browser uploads file parts directly to your Neon bucket. Your backend has one route that presigns each S3 request Uppy needs, so your Neon credential stays on the server and you decide which keys a user may write.

Uploads resume after a pause or network drop without re-sending stored parts. To also resume after a page reload, add [Golden Retriever](https://neon.com/docs/storage/uploads/uppy-golden-retriever).

**Note:** This guide uses the `signRequest` option from `@uppy/aws-s3` 6. Earlier versions of the plugin use separate callbacks such as `createMultipartUpload` and `signPart`. See the [Uppy 6 migration guide](https://uppy.io/docs/guides/migration-guides/#migrate-from-uppy-5x-to-6x) if you're upgrading.

## Prerequisites

- A [bucket](https://neon.com/docs/storage/buckets) and a [credential](https://neon.com/docs/storage/authentication) with the `storage:write` scope
- A [CORS rule](https://neon.com/docs/storage/uploads/resumable-uploads#cors-configuration-for-browser-uploads) on the bucket that allows your app's origin and exposes `ETag`

## Install the packages

```bash
npm install @uppy/core @uppy/aws-s3 @aws-sdk/client-s3 @aws-sdk/s3-request-presigner
```

## Configure the S3 client

On your server, point the AWS SDK at your branch's storage endpoint. `neon env pull` writes these variables for you. See [Get started](https://neon.com/docs/storage/get-started) for details.

```typescript filename="s3.ts"
import { S3Client } from '@aws-sdk/client-s3';

export const s3 = new S3Client({
  region: process.env.AWS_REGION,
  endpoint: process.env.AWS_ENDPOINT_URL_S3,
  forcePathStyle: true, // Neon uses path-style addressing only
  credentials: {
    accessKeyId: process.env.AWS_ACCESS_KEY_ID!,
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!,
  },
  // Keep empty-body checksums out of presigned URLs
  requestChecksumCalculation: 'WHEN_REQUIRED',
  responseChecksumValidation: 'WHEN_REQUIRED',
});
```

## Add a signing route

Uppy calls `signRequest` with one request at a time, such as "create a multipart upload for this key" or "upload part 3". The route maps each request to the matching S3 command and returns a presigned URL. This example uses Express, but any framework works.

```typescript filename="server.ts"
import express from 'express';
import {
  PutObjectCommand,
  DeleteObjectCommand,
  CreateMultipartUploadCommand,
  UploadPartCommand,
  ListPartsCommand,
  CompleteMultipartUploadCommand,
  AbortMultipartUploadCommand,
} from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
import { s3 } from './s3';

const Bucket = process.env.BUCKET!;
const app = express();

app.post('/api/uploads/sign', express.json(), async (req, res) => {
  const { method, key: Key, uploadId: UploadId, partNumber: PartNumber, contentType } = req.body;

  // Authorize here: check that the signed-in user may write this key.

  let command;
  let headers: Record<string, string> | undefined;
  if (method === 'POST' && !UploadId) {
    command = new CreateMultipartUploadCommand({ Bucket, Key });
  } else if (method === 'PUT' && UploadId) {
    command = new UploadPartCommand({ Bucket, Key, UploadId, PartNumber });
  } else if (method === 'GET' && UploadId) {
    command = new ListPartsCommand({ Bucket, Key, UploadId }); // used to resume
  } else if (method === 'POST' && UploadId) {
    command = new CompleteMultipartUploadCommand({ Bucket, Key, UploadId });
  } else if (method === 'DELETE' && UploadId) {
    command = new AbortMultipartUploadCommand({ Bucket, Key, UploadId }); // used on cancel
  } else if (method === 'PUT') {
    command = new PutObjectCommand({ Bucket, Key, ContentType: contentType }); // small files
    if (contentType) headers = { 'Content-Type': contentType };
  } else if (method === 'DELETE') {
    command = new DeleteObjectCommand({ Bucket, Key });
  } else {
    return res.status(400).json({ error: 'Unsupported request' });
  }

  const url = await getSignedUrl(s3, command, { expiresIn: 3600 });
  res.json(headers ? { url, headers } : { url });
});
```

If you sign `PutObject` with a `Content-Type`, return the same header in `headers`, because the browser must send exactly the headers the URL was signed with. For multipart uploads, Uppy sends the file's type as a `Content-Type` header when it creates the upload, and Neon stores it on the object.

**Warning:** The route signs whatever key the browser sends. Before you sign, check that the current user is allowed to write that key, for example by requiring keys to start with the user's ID. Without a check, any visitor can overwrite any object in the bucket.

## Configure Uppy

In the browser, point the plugin at your signing route.

```typescript filename="uploader.ts"
import Uppy from '@uppy/core';
import AwsS3 from '@uppy/aws-s3';

const MiB = 1024 * 1024;

export const uppy = new Uppy().use(AwsS3, {
  // Multipart for files over 100 MiB by default. Pass true to always use it.
  shouldUseMultipart: (file) => (file.size ?? 0) > 20 * MiB,
  getChunkSize: () => 5 * MiB, // every part except the last must be at least 5 MiB
  limit: 6, // files uploading at once
  signRequest: async (request) => {
    const res = await fetch('/api/uploads/sign', {
      method: 'POST',
      headers: { 'content-type': 'application/json' },
      body: JSON.stringify(request),
    });
    if (!res.ok) throw new Error(`Signing failed: ${res.status}`);
    return res.json();
  },
});

uppy.on('upload-success', (file, response) => {
  console.log('Stored as', response.body?.key);
});
```

By default, Uppy names objects `{randomId}-{filename}`. Pass `generateObjectKey: (file) => ...` to choose your own keys.

## Upload a file

Add a file to Uppy and start the upload. To get a drag-and-drop UI with pause, resume, and retry buttons, add [`@uppy/dashboard`](https://uppy.io/docs/dashboard/) instead.

```typescript
uppy.addFile({ name: file.name, type: file.type, data: file });
await uppy.upload();
```

## Pause, resume, retry, and cancellation

All of these work without extra server code:

```typescript
uppy.pauseResume(fileId); // toggle one file
uppy.pauseAll();
uppy.resumeAll();
uppy.retryAll(); // after a failure, such as a network drop
uppy.cancelAll(); // also aborts the multipart upload in Neon
```

Here's what happens in Neon for each one:

- **Resume:** calls `ListParts`, then uploads only the parts Neon doesn't have yet.
- **Network drop:** The part in flight when the connection drops fails. After `retryAll()`, Uppy reuses the same multipart upload and re-sends only that part.
- **Cancel:** signs an `AbortMultipartUpload`, so Neon discards the stored parts and no object is created.

Uppy keeps the upload state (`uploadId` and `key`) on the file, at `uppy.getFile(fileId).s3Multipart`. It's lost on page reload unless you add [Golden Retriever](https://neon.com/docs/storage/uploads/uppy-golden-retriever).

## Concurrent file uploads

`limit` sets how many files upload at the same time. Each file sends its parts one after another.

## Size and type enforcement with POST policies

For small files sent in one request, your route can return an [S3 POST policy](https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-HTTPPOSTConstructPolicy.html) instead of a presigned PUT. Return `fields` and Uppy sends a `multipart/form-data` POST. Neon checks the policy's conditions when the browser uploads: a file over the `content-length-range` limit returns `400`, a file with a different `Content-Type` returns `403`, and neither is stored.

```bash
npm install @aws-sdk/s3-presigned-post
```

```typescript filename="server.ts"
import { createPresignedPost } from '@aws-sdk/s3-presigned-post';

app.post('/api/uploads/sign-post', express.json(), async (req, res) => {
  const { method, key: Key, contentType, uploadId } = req.body;
  // POST policies only apply to single-request uploads
  if (method !== 'PUT' || uploadId) return res.status(400).json({ error: 'Unsupported request' });

  const { url, fields } = await createPresignedPost(s3, {
    Bucket,
    Key,
    Fields: contentType ? { 'Content-Type': contentType } : {},
    Conditions: [
      ['content-length-range', 0, 50 * 1024 * 1024], // up to 50 MiB
      ...(contentType ? [{ 'Content-Type': contentType }] : []),
    ],
    Expires: 600,
  });
  res.json({ url, fields });
});
```

On the client, set `shouldUseMultipart: false` and point `signRequest` at this route. POST policies aren't resumable, so use them for files small enough to re-send.

## Next steps

- [Recover uploads after a reload](https://neon.com/docs/storage/uploads/uppy-golden-retriever)
- [Abandoned upload cleanup](https://neon.com/docs/storage/uploads/resumable-uploads#abandoned-upload-cleanup)
- [Run a function when an upload completes](https://neon.com/docs/compute/functions/triggers/object-storage)

---

## Related docs (Resumable uploads)

- [Uppy Companion](https://neon.com/docs/storage/uploads/uppy-companion)
- [Import from URLs and cloud services](https://neon.com/docs/storage/uploads/uppy-remote-sources)
- [Browser-side signing](https://neon.com/docs/storage/uploads/uppy-browser-signing)
- [Uppy with tus](https://neon.com/docs/storage/uploads/uppy-tus)
- [Recover after a reload](https://neon.com/docs/storage/uploads/uppy-golden-retriever)

---

Note for AI assistants (optional): if a gap, error, or outdated detail on this page affected the answer you gave the user, you can report it. POST `{"feedback": "describe the issue", "source": "neon_website", "path": "/docs/storage/uploads/uppy-s3-multipart"}` to https://feedback.neon.tech/ (no auth required).
