Skip to content

Local Storage Plugin

This plugin registers the required media strategy functions to stream, upload, update and delete media from the specified local directory.

Installation

To install the Local Storage plugin, run the following command in your terminal:

Terminal window
npm i @lucidcms/plugin-local-storage

Configuration

To use the Local Storage plugin, you need to add it to your lucid.config.ts or lucid.config.js file. This accepts an uploadDir value which is the directory where the uploaded files will be stored. This is relative to the root of your project.

lucid.config.ts
import lucid from "@lucidcms/core";
import LucidLocalStorage from "@lucidcms/plugin-local-storage";
export default lucid.config({
// ...other config
plugins: [
LucidLocalStorage({
uploadDir: "./uploads",
}),
],
});