Upload files to AWS S3

This example shows you how to implement a smart action to upload image files to an AWS S3 bucket. Here we have a companies model that has two fields corresponding to files stored in an AWS S3 bucket:

  • A certificate of incorporation

  • A proof of identity

We implemented a smart action to upload the files for each company.

Requirements

How it works

Directory: /models

This directory contains the companies.js file where the companies model is declared.

Directory: /forest

This directory contains the companies.js file where the smart action Upload Legal Docs is declared.

circle-info

You need to specify that the widget file picker is applicable to the input field used to upload the file.

Directory: /services

This directory contains an s3-helper.js file where the methods to upload files to s3 is declared.

circle-info

You need to configure your AWS credentials inside your app to get access to your bucket. You can read more about it in the AWS documentation herearrow-up-right.

Directory: /routes

This directory contains the companies.js file where the logic of the smart action is implemented.

Last updated