Skip to main content

Installation

Install the Filejar client and required dependencies:

Setup

Create Filejar Client

Create a Filejar service in your NestJS application:

Register File Interceptor

File upload limits are configured directly in the interceptor options (shown in the controller examples below).

Single File Upload Endpoint

Create a controller to upload a single file:

Multiple Files Upload Endpoint

Create an endpoint to upload multiple files:

Retrieve Files from Database

Create endpoints to retrieve file information:

Client-Side Usage

Upload Single File

Upload Multiple Files

Retrieve File

Simply use the file key to construct the URL:

Complete Example

Here’s a complete NestJS module setup: