ScaffoldHub
  • Introduction
  • Modeling
  • Setup
    • NextJS
    • File Storage
    • Payments with Stripe
  • Debugging
  • End-to-end and Unit Tests
  • Deployment
    • Deploy to Vercel
  • Features
    • Projects
    • Preview
    • Tenants
    • Subscriptions and Payments
    • Security
    • File Storage
    • Authentication
      • Sign-in and Sign-up and Social Sign-in
      • Invitation
      • Password Reset
      • Password Change
      • Email Verification
    • Entity
      • Form
      • Filter and List
      • Export
      • Import
    • Audit Logs
    • Internationalization (I18n)
    • API Keys
    • API Documentation
  • Package.json
  • Support
  • Changelog
    • Documentation
    • Scaffolds
  • Custom Development
  • Legacy Scaffolds
  • Go to ScaffoldHub
Powered by GitBook
On this page
  • Configuration
  • AWS S3 and Google Cloud Credentials
  • Localhost
  1. Features

File Storage

PreviousSecurityNextAuthentication

Last updated 1 year ago

This section gives details on how ScaffoldHub implements file storage.

For setup, refer to .

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.

Setup > File Storage