Skip to main content
Source: Cross-cutting guide — references equa-server/modules/file-storage/ used by organization-endpoints.ts, data-room-endpoints.ts, and microsoft-endpoints.ts

File Storage Endpoints

Equa uses Amazon S3 for file storage. The file storage module provides upload middleware, download handlers, and file management utilities used across multiple endpoint groups.

Architecture

The file storage module (file-storage) is a shared library used by:
  • Organization endpoints — organization-level file uploads
  • Data Room endpoints — data room document uploads
  • Microsoft endpoints — hybrid Microsoft/S3 document storage
  • Cap Table endpoints — certificate PDF storage
Files are stored in S3 with the bucket and credentials configured via environment variables.

Configuration

VariableDescription
AWS_S3_ACCESS_KEYS3 access key
AWS_S3_SECRET_KEYS3 secret key
AWS_S3_REGIONS3 region
AWS_S3_BUCKETS3 bucket name
AWS_S3_UPLOAD_SIZE_LIMIT_MBMax upload size for organization files (default 10)
DATA_ROOM_UPLOAD_SIZE_LIMIT_MBMax upload size for data room files (default 10)

Upload

Organization File Upload

POST /v1/organization/:organization/file
FieldValue
AuthRequired
PermissioncanEditDocuments
Content-Typemultipart/form-data
Upload a file to the organization’s S3 storage. The upload middleware handles multipart parsing and streams the file to S3. Request: Multipart form with a file field. Size limit: Configurable via AWS_S3_UPLOAD_SIZE_LIMIT_MB (default 10 MB).

Data Room Upload

POST /v1/organization/:organization/document
FieldValue
AuthRequired
PermissioncanEditDocuments
Content-Typemultipart/form-data
Upload documents to the data room. Supports multiple file uploads. Size limit: Configurable via DATA_ROOM_UPLOAD_SIZE_LIMIT_MB (default 10 MB).

Download

Download as Attachment

GET /v1/file/:file/content
FieldValue
AuthRequired
PermissioncanViewFile
Download a file from S3 with Content-Disposition: attachment. The browser will prompt to save the file.

View Inline

GET /v1/file/:file/content/:name
FieldValue
AuthRequired
PermissioncanViewFile
Serve a file from S3 with Content-Disposition: inline. The browser will attempt to display the file (PDFs, images). The :name parameter is used for the filename in the response headers and does not affect which file is served.

Data Room Download

GET /v1/organization/:organization/document/:document/content
FieldValue
AuthRequired
PermissioncanViewDocuments
Download a data room document as an attachment.

Data Room View Inline

GET /v1/organization/:organization/document/:document/content/:name
FieldValue
AuthRequired
PermissioncanViewDocuments
View a data room document inline in the browser.

Upload Middleware

The file storage module provides reusable upload middleware:
  • uploadMiddlewareUsingMemory — parses multipart uploads into memory buffers before uploading to S3
  • Supports configurable max file size in megabytes
  • Supports single or multiple file uploads (UploadPlurality.single / UploadPlurality.multiple)
  • Wallet Endpoints — blockchain wallet address management (separate from file storage)