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:
npm i @lucidcms/plugin-local-storage
pnpm i @lucidcms/plugin-local-storage
yarn add @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.
import lucid from "@lucidcms/core";import LucidLocalStorage from "@lucidcms/plugin-local-storage";
export default lucid.config({ // ...other config plugins: [ LucidLocalStorage({ uploadDir: "./uploads", secretKey: 'MY_SECRET_KEY', supportedMimeTypes: ['image/jpeg', 'image/png'], // optional, default array supports a wide range of common mime types. }), ],});