0.1.2 • Published 6 days ago

@websolutespa/payload-plugin-cloud-storage-fs v0.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 days ago

@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

OptionTypeDescription
baseDirstringLocal or remote directory to use for file storage
baseURLstringBase 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
0.1.2

6 days ago

0.1.1

3 months ago

0.1.0

8 months ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago