File Storage

This section gives details on how ScaffoldHub implements file storage.

For setup, refer to Setup > File Storage.

Configuration

Each feature has its storage configuration file, and you can find it at src/features/[feature]/[feature]Storage.ts.

  • id: Unique ID used to identify the rule on permissions and upload.

  • folder: Folder where the files will be saved. It accepts an:tenantId argument that, when saved, is replaced by its real value.

  • maxSizeInBytes: Max allowed size in bytes.

  • publicRead: The file can be publicly accessed via the URL without a signed token.

AWS S3 and Google Cloud Credentials

For Amazon S3 and Google Cloud Storage, the uploaded files do not pass through the backend. The backend creates credentials that allow the front end to submit directly to the file storage provider.

Before sending the credentials to the frontend, the backend validates if the user has all the needed permissions.

Localhost

The localhost differs from the Amazon S3 and Google Cloud Storage. Instead of generating a provider's token, it uses the JWT token of the current application to pass it to another endpoint that only validates this token and handles the upload to the localhost server.

Last updated