kfiross

payload storage file explorer

by kfiross
Cloud storage
v3
^3.37.0

Overview

Summary generated from the README

Adds an admin view, default route /explorer, for browsing remote S3-compatible storage such as AWS S3, MinIO or LocalStack. It registers Payload endpoints for listing, presigned upload and download, folder creation and deletion. Behaviour is configured through plugin options and per-operation access callbacks. Requires Payload 3.37 or later.

Features

  • List and paginate folders and files with sizes and last-modified dates in list or grid views
  • Presigned POST uploads with drag and drop, size limits, and MIME type and extension restrictions
  • Presigned URLs for previewing and downloading objects
  • Create folders and delete single objects or whole prefixes recursively
  • Bulk select to download or delete multiple files
  • Per-operation access callbacks, root prefix scoping and toggles to disable uploads, deletes or downloads

Use cases

  • Manage files in an S3 or MinIO bucket directly from the Payload admin without a separate tool
  • Restrict upload and delete permissions on bucket contents to specific admin roles
  • Scope editors to a subfolder of a shared bucket using a root prefix

From the author

File explorer for Payload CMS 3.0

Installation

npm i @kfiross44/payload-storage-file-explorer

12

Stars

0

Forks

1

Open Issues

4 months ago

Last Updated

32

Weekly Downloads

v1.2.1

npm Version

346.0 KB

Unpacked Size

1

Dependencies

GitHub stars

120 since Sep 7

Show data
GitHub stars by day (UTC)
DateStars
Dec 6, 202612
Dec 5, 202612
Dec 4, 202612
Dec 3, 202612
Dec 2, 202612
Dec 1, 202612
Nov 30, 202612
Nov 29, 202612
Nov 28, 202612
Nov 27, 202612
Nov 26, 202612
Nov 25, 202612
Nov 24, 202612
Nov 23, 202612
Nov 22, 202612
Nov 21, 202612
Nov 20, 202612
Nov 19, 202612
Nov 18, 202612
Nov 17, 202612
Nov 16, 202612
Nov 15, 202612
Nov 14, 202612
Nov 13, 202612
Nov 12, 202612
Nov 11, 202612
Nov 10, 202612
Nov 9, 202612
Nov 8, 202612
Nov 7, 202612
Nov 6, 202612
Nov 5, 202612
Nov 4, 202612
Nov 3, 202612
Nov 2, 202612
Nov 1, 202612
Oct 31, 202612
Oct 30, 202612
Oct 29, 202612
Oct 28, 202612
Oct 27, 202612
Oct 26, 202612
Oct 25, 202612
Oct 24, 202612
Oct 23, 202612
Oct 22, 202612
Oct 21, 202612
Oct 20, 202612
Oct 19, 202612
Oct 18, 202612
Oct 17, 202612
Oct 16, 202612
Oct 15, 202612
Oct 14, 202612
Oct 13, 202612
Oct 12, 202612
Oct 11, 202612
Oct 10, 202612
Oct 9, 202612
Oct 8, 202612
Oct 7, 202612
Oct 6, 202612
Oct 5, 202612
Oct 4, 202612
Oct 3, 202612
Oct 2, 202612
Oct 1, 202612
Sep 30, 202612
Sep 29, 202612
Sep 28, 202612
Sep 27, 202612
Sep 26, 202612
Sep 25, 202612
Sep 24, 202612
Sep 23, 202612
Sep 22, 202612
Sep 21, 202612
Sep 20, 202612
Sep 19, 202612
Sep 18, 202612
Sep 17, 202612
Sep 16, 202612
Sep 15, 202612
Sep 14, 202612
Sep 13, 202612
Sep 12, 202612
Sep 11, 202612
Sep 10, 202612
Sep 9, 202612
Sep 8, 202612
Sep 7, 202612
npm weekly downloads

29−10 since Sep 7

Show data
npm weekly downloads by day (UTC)
DateWeekly downloads
Dec 6, 202629
Dec 5, 202617
Dec 4, 202617
Dec 3, 202618
Dec 2, 202616
Dec 1, 202616
Nov 30, 202624
Nov 29, 202624
Nov 28, 202621
Nov 27, 202622
Nov 26, 202621
Nov 25, 202620
Nov 24, 202613
Nov 23, 202620
Nov 22, 202622
Nov 21, 202621
Nov 20, 202619
Nov 19, 202622
Nov 18, 202638
Nov 17, 202642
Nov 16, 202628
Nov 15, 202626
Nov 14, 202635
Nov 13, 202638
Nov 12, 202635
Nov 11, 202621
Nov 10, 202627
Nov 9, 202626
Nov 8, 202626
Nov 7, 202628
Nov 6, 202628
Nov 5, 202631
Nov 4, 202632
Nov 3, 202630
Nov 2, 202632
Nov 1, 202637
Oct 31, 202631
Oct 30, 202633
Oct 29, 202630
Oct 28, 202627
Oct 27, 202623
Oct 26, 202628
Oct 25, 202631
Oct 24, 202631
Oct 23, 202626
Oct 22, 202631
Oct 21, 202652
Oct 20, 202647
Oct 19, 202642
Oct 18, 202637
Oct 17, 202641
Oct 16, 202645
Oct 15, 202652
Oct 14, 202631
Oct 13, 202634
Oct 12, 202637
Oct 11, 202635
Oct 10, 202630
Oct 9, 202633
Oct 8, 202635
Oct 7, 202638
Oct 6, 202640
Oct 5, 202643
Oct 4, 202645
Oct 3, 202645
Oct 2, 202651
Oct 1, 202645
Sep 30, 202648
Sep 29, 202643
Sep 28, 202638
Sep 27, 202635
Sep 26, 202636
Sep 25, 202623
Sep 24, 202615
Sep 23, 202612
Sep 22, 202614
Sep 21, 202619
Sep 20, 202630
Sep 19, 202625
Sep 18, 202625
Sep 17, 202629
Sep 16, 202628
Sep 15, 202633
Sep 14, 202627
Sep 13, 202616
Sep 12, 202616
Sep 11, 202625
Sep 10, 202627
Sep 9, 202637
Sep 8, 202634
Sep 7, 202639

Each point is npm's rolling 7-day download count.

Health Score

45/100Fair

Composite score based on GitHub activity, stars, npm downloads, publish recency, dependency count, and package size.

Badge for your README

Payload Directory health badge
Markdown
[![Payload Directory](https://payloaddirectory.dev/badge/1243711735-root.svg)](https://payloaddirectory.dev/plugins/1243711735-root)
HTML
<a href="https://payloaddirectory.dev/plugins/1243711735-root"><img src="https://payloaddirectory.dev/badge/1243711735-root.svg" alt="Payload Directory"></a>
Updated Aug 5, 2026Created May 19, 2026Published Jun 4, 2026

README

Payload Storage File Explorer

A Payload CMS plugin that adds a file explorer for Remote file storages (S3-compatible for now) to the Payload admin. It mounts an admin view and registers small Payload endpoints to list, preview, download, upload (presigned POST), create folders, and delete objects or prefixes.

Home

Overview

  • Admin UI: Adds a configurable admin route (default /explorer) with list/grid views, previews, drag & drop uploads, bulk actions and folder navigation.
  • Server endpoints: Registers Payload endpoints under /api/s3-explorer for listing, presigned uploads, presigned downloads, folder creation and deletion.
  • S3-compatible: Uses AWS SDK for S3 but supports custom endpoints (MinIO, LocalStack) and path-style URLs.

Features

  • Browse buckets: paginate and show folders/files with sizes and last-modified.
  • Preview & download: presigned GET URLs for preview/download of objects.
  • Direct uploads: presigned POST (browser → S3) with size and MIME constraints.
  • Folder create: creates zero-byte "folder" placeholder objects (key ends with /).
  • Delete: delete single objects or recursively delete a prefix (folder).
  • Bulk actions: select multiple files to download or delete.
  • Configurable: enable/disable uploads, deletes, downloads; set root prefix, max upload size, presigned expiry, navigation label and admin route and access-level per actions.

Quick Install

  1. Install the package in your project (example using pnpm):
pnpm add payload-storage-file-explorer
  1. Add the plugin to your Payload config (payload.config.ts):
import { payloadStorageFileExplorer, s3ExplorerPluginOptions } from 'payload-storage-file-explorer'

export default buildConfig({
  plugins: [
    payloadStorageFileExplorer({
      adapterOptions: s3ExplorerPluginOptions({
        bucket: process.env.S3_BUCKET!,
        credentials: {
          accessKeyId: process.env.S3_ACCESS_KEY!,
          secretAccessKey: process.env.S3_SECRET_KEY!,
        },
        endpoint: process.env.S3_ENDPOINT!,
        region: process.enn.S3_REGION,
        forcePathStyle: true,
        storageType: 's3',
      }),

      // Optional: custom route & label
      adminRoute: '/explorer',
      navigationLabel: 'File Explorer',

      // Optional overrides
      maxUploadSize: 50 * 1024 * 1024, // 50 MB

      // Optional: disable features
      enableDelete: true,
      enableDownload: true,
      enableFolderCreate: true,
      enableUpload: true,

      // Optional: presigned URL expiry (seconds)
      presignedUrlExpiry: 3600,

      // Optional: scope to a subfolder
      // rootPrefix: 'uploads/',

      // Optional: limit files types to be uploaded, also by extension
      allowedMimeTypes: [
        'image/*',
        'application/pdf',
        'video/*'
      ],
      allowedExtensions: [
        'png',
        'pdf',
        'mp4'
      ],

      // Optional: scope operation per users
      access: {
        canUpload: async ({ req }) => {
          'use server'
          return Boolean(req.user) && req?.user?.role === 'admin';
        },
        canDelete: async ({ req }) => {
          'use server'
          return Boolean(req.user) && req?.user?.email === 'super-admin';
        }
      },
    }),
  ],
})
  • Configuration options
OptionDescriptionDefault
adapterOptionsRequired adapter configuration. Currently the plugin supports an S3-compatible adapter; see S3ExplorerPluginOptions.Required
adminRouteAdmin path where the view is mounted./explorer
enableDeleteAllow deleting objects/prefixes.true
enableDownloadEnable presigned downloads.true
enableFolderCreateAllow creating folders.true
enableUploadAllow uploads.true
maxUploadSizeMax upload size in bytes.50 * 1024 * 1024 (50 MB)
navigationLabelLabel for admin sidebar.File Explorer
presignedUrlExpiryPresigned GET expiry in seconds.3600
rootPrefixOptional root prefix to scope explorer to a subfolder.''
accessOptional access callbacks to control per-operation permissions. Supported callbacks:
canList,
canDownload,
canUpload,
canDelete,
canCreateFolder.

Each callback receives an object with { req, key?, prefix?, item? } and may be async; return true to allow the operation for the current user/item.
If omitted, global enable_X booleans control behavior.
-
pageTitleOptional naming to page titleS3 File explorer
allowedMimeTypesAllowed files to be upladed by their MIME type* (Any)
allowedExtensionsAllowed files to be uploaded by their extension* (Any)

API Endpoints

All endpoints are registered on the plugin and available under /api/file-explorer.

  • GET /api/file-explorer/list?prefix=<prefix>&token=<continuationToken>
    • Response: { success: true, data: S3ListResult }
  • GET /api/file-explorer/download?key=<objectKey>
    • Returns a presigned GET URL: { success: true, data: { key, url } }
  • POST /api/file-explorer/upload
    • Body: { prefix, filename, contentType }
    • Returns presigned POST details: { success: true, data: { url, fields, key } }
  • POST /api/file-explorer/folder — create new folder placeholder
    • Body: { prefix, name } → { success: true, data: { folderKey } }
  • DELETE /api/file-explorer/delete
    • Body: { key } deletes a single object OR { prefix } deletes all objects under that prefix (recursive)

Examples (list & download):

curl 'http://localhost:3000/api/file-explorer/list?prefix=media/'

curl 'http://localhost:3000/api/file-explorer/download?key=media/example.jpg'

Adapters

This plugin is built to support interchangeable storage adapters. At present it ships with an S3-compatible adapter. Future releases may add additional adapters (e.g., Vercel Blob, Google Cloud Storage, Azure Blob).

S3 (current)

Use the s3ExplorerPluginOptions() helper to build S3 adapter options. Supported S3 adapter options:

  • bucket (string) — required S3 bucket name.
  • region (string) — AWS region.
  • credentials — optional { accessKeyId, secretAccessKey, sessionToken? }.
  • endpoint — optional custom endpoint (MinIO, LocalStack).
  • forcePathStyle — boolean for path-style URLs (MinIO/local testing).

The plugin will fall back to environment credentials / IAM role if credentials are omitted.

License & support

This repository is provided as-is. For questions about Payload integration, contact the Payload team or open an issue in this repository.

Similar plugins