Skip to main content
Skip to main content

File Service

In this document, you’ll learn what a file service is in Medusa.

Introduction

A file service defines how files are stored in the Medusa Backend. Those files include products’ images and files used to import or export data.

Medusa Backend includes a default file service that acts as a placeholder, but does not actually perform any storage functionalities. So, you must either install one of the existing file-service plugins, such as MinIO or S3, or create your own file service if you want to utilize storage functionalities.

A file service is a TypeScript or JavaScript class that extends the AbstractFileService class from the core @medusajs/medusa package. By extending this class, the file service must implement the necessary methods that take care of general upload and download functionalities. The Medusa Backend then uses these methods when necessary, for example, when a product image is uploaded.


Custom Development

Developers can create a custom file service with the desired functionality directly within the Medusa Core, in a plugin, or in a module.

Was this section helpful?