@websolutespa/payload-plugin-cloud-storage-fs
v0.1.3
Published
File system adapter for the PayloadCms plugin Cloud Storage
Downloads
34
Readme
@websolutespa/payload-plugin-cloud-storage-fs
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. |