www/apps/resources/app/infrastructure-modules/file/local/page.mdx
import { Table } from "docs-ui"
export const metadata = {
title: Local File Module Provider,
}
The Local File Module Provider stores files uploaded to your Medusa application in the /uploads directory.
static (or other configured) directory.The Local File Module Provider is registered by default in your application.
</Note>Add the module into the providers array of the File Module:
The File Module accepts one provider only.
</Note>import { Modules } from "@medusajs/framework/utils"
// ...
module.exports = {
// ...
modules: [
{
resolve: "@medusajs/medusa/file",
options: {
providers: [
{
resolve: "@medusajs/medusa/file-local",
id: "local",
options: {
// provider options...
},
},
],
},
},
],
}
`upload_dir`
</Table.Cell>
<Table.Cell>
The directory to upload files to. Medusa exposes the content of the `static` directory publicly. If you change the directory, it must be served and publicly accessible.
</Table.Cell>
<Table.Cell>
`static`
</Table.Cell>
</Table.Row>
<Table.Row>
<Table.Cell>
`backend_url`
</Table.Cell>
<Table.Cell>
The URL that serves the files.
</Table.Cell>
<Table.Cell>
`http://localhost:9000/static`
</Table.Cell>
</Table.Row>
</Table.Body>
</Table>