> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackshift.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Direct browser uploads

> Create a short-lived signed upload URL on your server, then PUT the file directly from the browser.

<Tip>
  **Live.** This area is documented as current, user-reliable behavior.
</Tip>

## Goal

Avoid routing large user files through your own application server.

## Prerequisites

* A backend route that can safely create signed upload URLs
* A browser File object

## Workflow

<Steps>
  <Step>
    Your backend calls assets.signedUploadUrl with bucket, key, visibility, expiresIn, and maxBytes.
  </Step>

  <Step>
    Your frontend uploads the File to the returned URL with the returned HTTP method.
  </Step>

  <Step>
    StackShift validates the token, stores the file, and returns asset metadata.
  </Step>
</Steps>

## Server creates the upload URL

```ts theme={null}
const upload = await stackshift.assets.signedUploadUrl({
  bucket: 'avatars',
  key: 'users/user_123.png',
  visibility: 'public',
  expiresIn: '10m',
  maxBytes: 5_000_000,
})
```

## Browser uploads the file

```ts theme={null}
await fetch(upload.url, {
  method: upload.method,
  body: file,
  headers: { 'Content-Type': file.type },
})
```

## Expected result

<Check>
  The browser uploads directly to StackShift Assets without receiving API credentials.
</Check>

## Related guides

<CardGroup cols={2}>
  <Card title="Assets SDK quick start" href="/assets/sdk-quick-start">
    Install a StackShift SDK and upload files from Node/TypeScript, NestJS, Python, or Go.
  </Card>

  <Card title="Private assets and signed URLs" href="/assets/private-assets-and-signed-urls">
    Keep files private by default and generate short-lived URLs only when a user should download them.
  </Card>

  <Card title="Upload UX and DAM" href="/assets/upload-ux-and-dam">
    Use resumable upload sessions, progress-aware browser uploads, tags, folders, search, bulk actions, and usage summaries.
  </Card>
</CardGroup>
