Files
medusa-store/www/apps/resources/app/architectural-modules/file/local/page.mdx
Shahed Nasser 938f3bd934 docs: update to next 15 + eslint 9 (#9839)
* update next

* updated react

* update eslint

* finish updating eslint

* fix content lint errors

* fix docs test

* fix vale action

* fix installation errors
2024-11-13 17:03:17 +02:00

108 lines
2.0 KiB
Plaintext

import { Table } from "docs-ui"
export const metadata = {
title: `Local File Module Provider`,
}
# {metadata.title}
The Local File Module Provider stores files uploaded to your Medusa application in the `/uploads` directory.
<Note type="warning">
The Local File Module Provider is only for development purposes. Use the [S3 File Module Provider](../s3/page.mdx) in production instead.
</Note>
---
## Register the Local File Module
<Note>
The Local File Module Provider is registered by default in your application.
</Note>
Add the module into the `providers` array of the File Module:
<Note>
The File Module accepts one provider only.
</Note>
```ts title="medusa-config.ts"
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...
},
},
],
},
},
],
}
```
### Local File Module Options
<Table>
<Table.Header>
<Table.Row>
<Table.HeaderCell>Option</Table.HeaderCell>
<Table.HeaderCell>Description</Table.HeaderCell>
<Table.HeaderCell>Default</Table.HeaderCell>
</Table.Row>
</Table.Header>
<Table.Body>
<Table.Row>
<Table.Cell>
`upload_dir`
</Table.Cell>
<Table.Cell>
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.
</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>