File system adapter for the PayloadCms plugin Cloud Storage.
This repository contains an FileSystem adapter for the official Payload Cloud Storage Plugin implemented with the fs.promises library.
- Payload version 1.0.19 or higher is required.
npm i @websolute/payload-plugin-cloud-storage-fs
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
],
});
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. |