@websolutespa/payload-plugin-cloud-storage-fs
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

@websolutespa/payload-plugin-cloud-storage-fs

npm version

status alpha

File system adapter for the PayloadCms plugin Cloud Storage.

Payload Cloud Storage Plugin FileSystem Adapter

This repository contains an FileSystem adapter for the official Payload Cloud Storage Plugin implemented with the fs.promises library.

Requirements:

  • Payload version 1.0.19 or higher is required.

Installation

npm i @websolute/payload-plugin-cloud-storage-fs

Usage

Install the cloudStorage plugin with the fsStorageAdapter within your Payload as follows:

import path from 'path';
import { buildConfig } from 'payload/config';
import { cloudStorage } from '@payloadcms/plugin-cloud-storage';
import { fsStorageAdapter } from '@websolute/payload-plugin-cloud-storage-fs';

export default buildConfig({
  plugins: [
    cloudStorage({
      collections: {
        'my-collection-slug': {
          adapter: fsStorageAdapter({
            baseDir: process.env.FS_STORAGE_BASEDIR,
            baseURL: process.env.FS_STORAGE_BASEURL,
          }),
        },
      },
    }),
    // The rest of your config goes here
  ],
});

Adapter options

Option Type Description
baseDir string Local or remote directory to use for file storage
baseURL string Base URL to use in the collections to serve the files if the plugin option disablePayloadAccessControl is enabled. See the plugin documentation for details.

this library is for internal usage and not production ready

Package Sidebar

Install

npm i @websolutespa/payload-plugin-cloud-storage-fs

Weekly Downloads

11

Version

0.1.1

License

MIT

Unpacked Size

16.5 kB

Total Files

27

Last publish

Collaborators

  • cbrualdi
  • actarian
  • websolute-admin