Local File Module Provider

The Local File Module Provider stores files uploaded to your Medusa application in the /uploads directory.

WarningThe Local File Module Provider is only for development purposes. Use the S3 File Module Provider in production instead.

Register the Local File Module#

NoteThe Local File Module Provider is registered by default in your application.

Add the module into the providers array of the File Module:

NoteThe File Module accepts one provider only.
medusa-config.ts
1import { Modules } from "@medusajs/framework/utils"2
3// ...4
5module.exports = {6  // ...7  modules: [8    {9      resolve: "@medusajs/medusa/file",10      options: {11        providers: [12          {13            resolve: "@medusajs/medusa/file-local",14            id: "local",15            options: {16              // provider options...17            },18          },19        ],20      },21    },22  ],23}

Local File Module Options#

OptionDescriptionDefault

upload_dir

The directory to upload files to. Medusa exposes the content of the static directory publically. If you change the directory, it must be served and publically accessible.

static

backend_url

The URL that serves the files.

http://localhost:9000/static

Was this page helpful?
Edit this page