Skip to main content
Skip to main content
You're viewing the documentation for v1, which isn't the latest Medusa version.Latest documentation

IFileProvider

Overview

File provider interface for the file module.

Methods

upload

This method is used to upload a file

Parameters

The contents and metadata of the file. Among the file’s details, you can access the file’s path in the path property of the file object.

Returns

PromisePromise<ProviderFileResultDTO>Required
The details of the upload's result.

delete

This method is used to delete a file from storage.

Parameters

fileDataProviderDeleteFileDTORequired
The details of the file to remove.

Returns

PromisePromise<void>Required
Resolves when the file is deleted successfully.

getPresignedDownloadUrl

This method is used to retrieve a download URL of the file. For some file services, such as S3, a presigned URL indicates a temporary URL to get access to a file.

If your file service doesn’t perform or offer a similar functionality, you can just return the URL to download the file.

Parameters

fileDataProviderGetFileDTORequired
The details of the file.

Returns

PromisePromise<string>Required
The presigned URL to download the file
Was this section helpful?