Adds a file handler to a Payload upload collection that downloads a requested file from a configured origin site when it is missing locally. Files are saved into the local upload directory and then served by Payload as usual. It is meant for development only, requires local storage, and needs Payload 3.92 or newer.
Plugin to getting production files on a development server on demand.
Installation
npm i payload-files-proxy1
Stars
0
Forks
1
Open Issues
1 months ago
Last Updated
31
Weekly Downloads
v2.0.1
npm Version
23.7 KB
Unpacked Size
0
Dependencies
10 since Sep 6
| Date | Stars |
|---|---|
| Dec 5, 2026 | 1 |
| Dec 4, 2026 | 1 |
| Dec 3, 2026 | 1 |
| Dec 2, 2026 | 1 |
| Dec 1, 2026 | 1 |
| Nov 30, 2026 | 1 |
| Nov 29, 2026 | 1 |
| Nov 28, 2026 | 1 |
| Nov 27, 2026 | 1 |
| Nov 26, 2026 | 1 |
| Nov 25, 2026 | 1 |
| Nov 24, 2026 | 1 |
| Nov 23, 2026 | 1 |
| Nov 22, 2026 | 1 |
| Nov 21, 2026 | 1 |
| Nov 20, 2026 | 1 |
| Nov 19, 2026 | 1 |
| Nov 18, 2026 | 1 |
| Nov 17, 2026 | 1 |
| Nov 16, 2026 | 1 |
| Nov 15, 2026 | 1 |
| Nov 14, 2026 | 1 |
| Nov 13, 2026 | 1 |
| Nov 12, 2026 | 1 |
| Nov 11, 2026 | 1 |
| Nov 10, 2026 | 1 |
| Nov 9, 2026 | 1 |
| Nov 8, 2026 | 1 |
| Nov 7, 2026 | 1 |
| Nov 6, 2026 | 1 |
| Nov 5, 2026 | 1 |
| Nov 4, 2026 | 1 |
| Nov 3, 2026 | 1 |
| Nov 2, 2026 | 1 |
| Nov 1, 2026 | 1 |
| Oct 31, 2026 | 1 |
| Oct 30, 2026 | 1 |
| Oct 29, 2026 | 1 |
| Oct 28, 2026 | 1 |
| Oct 27, 2026 | 1 |
| Oct 26, 2026 | 1 |
| Oct 25, 2026 | 1 |
| Oct 24, 2026 | 1 |
| Oct 23, 2026 | 1 |
| Oct 22, 2026 | 1 |
| Oct 21, 2026 | 1 |
| Oct 20, 2026 | 1 |
| Oct 19, 2026 | 1 |
| Oct 18, 2026 | 1 |
| Oct 17, 2026 | 1 |
| Oct 16, 2026 | 1 |
| Oct 15, 2026 | 1 |
| Oct 14, 2026 | 1 |
| Oct 13, 2026 | 1 |
| Oct 12, 2026 | 1 |
| Oct 11, 2026 | 1 |
| Oct 10, 2026 | 1 |
| Oct 9, 2026 | 1 |
| Oct 8, 2026 | 1 |
| Oct 7, 2026 | 1 |
| Oct 6, 2026 | 1 |
| Oct 5, 2026 | 1 |
| Oct 4, 2026 | 1 |
| Oct 3, 2026 | 1 |
| Oct 2, 2026 | 1 |
| Oct 1, 2026 | 1 |
| Sep 30, 2026 | 1 |
| Sep 29, 2026 | 1 |
| Sep 28, 2026 | 1 |
| Sep 27, 2026 | 1 |
| Sep 26, 2026 | 1 |
| Sep 25, 2026 | 1 |
| Sep 24, 2026 | 1 |
| Sep 23, 2026 | 1 |
| Sep 22, 2026 | 1 |
| Sep 21, 2026 | 1 |
| Sep 20, 2026 | 1 |
| Sep 19, 2026 | 1 |
| Sep 18, 2026 | 1 |
| Sep 17, 2026 | 1 |
| Sep 16, 2026 | 1 |
| Sep 15, 2026 | 1 |
| Sep 14, 2026 | 1 |
| Sep 13, 2026 | 1 |
| Sep 12, 2026 | 1 |
| Sep 11, 2026 | 1 |
| Sep 10, 2026 | 1 |
| Sep 9, 2026 | 1 |
| Sep 8, 2026 | 1 |
| Sep 7, 2026 | 1 |
| Sep 6, 2026 | 1 |
25+11 since Sep 6
| Date | Weekly downloads |
|---|---|
| Dec 5, 2026 | 25 |
| Dec 4, 2026 | 33 |
| Dec 3, 2026 | 50 |
| Dec 2, 2026 | 50 |
| Dec 1, 2026 | 52 |
| Nov 30, 2026 | 53 |
| Nov 29, 2026 | 44 |
| Nov 28, 2026 | 37 |
| Nov 27, 2026 | 35 |
| Nov 26, 2026 | 23 |
| Nov 25, 2026 | 20 |
| Nov 24, 2026 | 21 |
| Nov 23, 2026 | 20 |
| Nov 22, 2026 | 22 |
| Nov 21, 2026 | 24 |
| Nov 20, 2026 | 22 |
| Nov 19, 2026 | 22 |
| Nov 18, 2026 | 36 |
| Nov 17, 2026 | 41 |
| Nov 16, 2026 | 43 |
| Nov 15, 2026 | 49 |
| Nov 14, 2026 | 49 |
| Nov 13, 2026 | 62 |
| Nov 12, 2026 | 75 |
| Nov 11, 2026 | 66 |
| Nov 10, 2026 | 60 |
| Nov 9, 2026 | 79 |
| Nov 8, 2026 | 76 |
| Nov 7, 2026 | 85 |
| Nov 6, 2026 | 388 |
| Nov 5, 2026 | 371 |
| Nov 4, 2026 | 366 |
| Nov 3, 2026 | 365 |
| Nov 2, 2026 | 346 |
| Nov 1, 2026 | 344 |
| Oct 31, 2026 | 341 |
| Oct 30, 2026 | 20 |
| Oct 29, 2026 | 17 |
| Oct 28, 2026 | 16 |
| Oct 27, 2026 | 16 |
| Oct 26, 2026 | 14 |
| Oct 25, 2026 | 12 |
| Oct 24, 2026 | 2 |
| Oct 23, 2026 | 2 |
| Oct 22, 2026 | 2 |
| Oct 21, 2026 | 2 |
| Oct 20, 2026 | 1 |
| Oct 19, 2026 | 1 |
| Oct 18, 2026 | 1 |
| Oct 17, 2026 | 2 |
| Oct 16, 2026 | 3 |
| Oct 15, 2026 | 4 |
| Oct 14, 2026 | 7 |
| Oct 13, 2026 | 7 |
| Oct 12, 2026 | 9 |
| Oct 11, 2026 | 11 |
| Oct 10, 2026 | 16 |
| Oct 9, 2026 | 23 |
| Oct 8, 2026 | 27 |
| Oct 7, 2026 | 26 |
| Oct 6, 2026 | 26 |
| Oct 5, 2026 | 24 |
| Oct 4, 2026 | 22 |
| Oct 3, 2026 | 19 |
| Oct 2, 2026 | 18 |
| Oct 1, 2026 | 16 |
| Sep 30, 2026 | 20 |
| Sep 29, 2026 | 29 |
| Sep 28, 2026 | 29 |
| Sep 27, 2026 | 29 |
| Sep 26, 2026 | 33 |
| Sep 25, 2026 | 27 |
| Sep 24, 2026 | 24 |
| Sep 23, 2026 | 22 |
| Sep 22, 2026 | 22 |
| Sep 21, 2026 | 22 |
| Sep 20, 2026 | 23 |
| Sep 19, 2026 | 17 |
| Sep 18, 2026 | 17 |
| Sep 17, 2026 | 21 |
| Sep 16, 2026 | 19 |
| Sep 15, 2026 | 10 |
| Sep 14, 2026 | 12 |
| Sep 13, 2026 | 10 |
| Sep 12, 2026 | 12 |
| Sep 11, 2026 | 12 |
| Sep 10, 2026 | 16 |
| Sep 9, 2026 | 16 |
| Sep 8, 2026 | 16 |
| Sep 7, 2026 | 14 |
| Sep 6, 2026 | 14 |
Each point is npm's rolling 7-day download count.
Health Score
Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.
Badge for your README
[](https://payloaddirectory.dev/plugins/938831442-root)<a href="https://payloaddirectory.dev/plugins/938831442-root"><img src="https://payloaddirectory.dev/badge/938831442-root.svg" alt="Payload Directory"></a>README
Small Payload CMS plugin to fetch missing media files from an origin site during local development, inspired by Drupal's stage_file_proxy approach.
Use this when you do not want to sync a large uploads folder locally but still need media files to appear in pages and the admin UI.
^22.23.4 || >=24.22.1 and Payload CMS ^3.92.0.npm install payload-files-proxy
# or
pnpm add payload-files-proxy
# or
yarn add payload-files-proxy
import path from 'path'
import { buildConfig } from 'payload'
import { payloadFilesProxy } from 'payload-files-proxy'
export default buildConfig({
collections: [
{
slug: 'media',
upload: {
staticDir: path.resolve('./uploads'),
},
},
],
plugins: [
payloadFilesProxy({
mediaCollectionSlug: 'media',
mediaDirectory: path.resolve('./uploads'),
originUrl: 'https://your-production-site.com',
disabled: process.env.NODE_ENV === 'production',
}),
],
})
payloadFilesProxy receives:
mediaCollectionSlug?: string
config.collections.mediaDirectory: string (required by type)
upload.staticDir is used, falling back to the collection slug.originUrl: string
disabled?: boolean
true, plugin is a no-op and config is returned unchanged.The plugin appends a file handler without replacing existing handlers. Payload checks read access before calling it. Document reads do not download files: on a file request, the handler checks the runtime local upload directory and fetches only a missing requested file. Payload then serves the local file, including its normal range handling. Image variants are fetched individually when requested.
Downloads are limited to 50 MiB and 15 seconds, require HTTP 200, and reject redirects. Completed downloads are published without overwriting an existing file; concurrent requests in the same process share a download. Failed downloads return HTTP 502 and are not cached.
disabled: true or NODE_ENV guard).mediaCollectionSlug matches your upload collection and read access permits the requestoriginUrl without redirects or authenticationThe dev/ directory contains the Payload development application. Development requires pnpm 11 (the project pins pnpm 11.25.0). Dependency install scripts are allowed only for sharp. Integration tests use Vitest, an isolated temporary SQLite database, and a local HTTP origin; they do not need production services.
pnpm install
DATABASE_URI=file:./dev/local.db PAYLOAD_CONFIG_PATH=./dev/payload.config.ts pnpm dev
Open http://localhost:3000/admin. The SQLite URI selects a local database; choose a different file if you want an isolated database. PAYLOAD_CONFIG_PATH points Next.js to the development Payload configuration. To regenerate the admin import map after changing components, run:
DATABASE_URI=file:./dev/local.db PAYLOAD_CONFIG_PATH=./dev/payload.config.ts pnpm dev:generate-importmap
The development configuration uses an external origin (https://inet2you.itfumh.es); missing files can only be fetched if that origin is reachable and serves the requested paths. Startup and tests do not require production services.
pnpm test
pnpm test:watch
PRs are welcome. If behavior changes, document migration notes clearly in the README.
MIT
Inspired by Drupal's stage_file_proxy module and similar on-demand media proxy patterns.
Topics
switch env
Switch the admin panel between development and production databases and copy production into development
68239/wk16v3
payload upstash
Upstash Redis key-value adapter for Payload's built-in KV store
82333/wk7v3 v4
payload typeid
TypeID identifiers for Payload collections, as native IDs or an extra type_id field, with PostgreSQL integrity guards
802.6k/wk0v3
payload kv
Store counters, feeds and expiring data in Redis or KV stores while querying them as normal Payload fields
771.4k/wk0v3 v4
payload surrealdb
SurrealDB database adapter for Payload CMS v3 and v4 using its PostgreSQL-compatible SQL interface
77268/wk3v3 v4
payload cache
Automatic Next.js 16 and Vercel cache tagging and invalidation for Payload reads
74321/wk0v3 v4