Skip to content

Storage

Overview

Storage in Oblax provides file and object storage for your application’s uploads, assets, and generated content. Storage integrates directly with modules — you can attach files to form submissions, store generated templates, or persist assets created by flux scripts. The platform handles the underlying infrastructure, so you interact with a simple API rather than managing buckets or filesystems.

Storage is available as a standalone module and as a service that custom microservices can call through gRPC.


Storage Model

Oblax storage uses a hierarchical model:

/project/<project_id>/storage/
  /uploads/
    /forms/
      frm_abc123def456/
        attachment_001.pdf
        photo_002.jpg
    /bookmarks/
      bmk_ghi789jkl012/
        screenshot.png
  /generated/
    /templates/
      welcome_email_html/
        rendered.html

Each file is identified by a path that combines the module, resource ID, and filename. The platform tracks metadata including content type, size, upload timestamp, and the user who uploaded the file.


Upload Flow

Files are uploaded through the SDK or REST API. The upload flow handles authentication, content-type validation, and storage persistence automatically.

SDK Upload

const file = document.getElementById('attachment').files[0];

await oblax.forms.submit('frm_abc123def456', {
  title: 'Support Request',
  attachment: file,
});

REST Upload

POST /v1/forms/frm_abc123def456/submissions
Content-Type: multipart/form-data

title=Support Request
attachment=@./report.pdf

File Metadata

Every stored file includes metadata:

FieldDescription
idUnique file identifier
pathStorage path within the project
contentTypeMIME type of the file
sizeFile size in bytes
uploadedByUser or service that uploaded the file
createdAtUpload timestamp
updatedAtLast modification timestamp

Access Control

File access follows the same ACL rules as API endpoints. A token must have permission to read the resource that owns the file. For example, a file attached to a form submission is accessible only to tokens that can read that form submission.

{
  "method": "get",
  "route": "/api/v1/forms/:id/attachments/:fileId",
  "allowedRealms": ["app:webapp", "app:admin"],
  "allowedRoles": ["user", "admin"]
}

Storage and Service Extension

Custom microservices can interact with storage through the platform’s gRPC API. When you build a service using obxfw, you can configure persistence targets that include storage operations.

{
  "persistence": {
    "mysql": {
      "target": "app",
      "object_name": "obx_uploads"
    }
  }
}

This lets custom services store and retrieve files alongside their domain data, maintaining a consistent storage model across standard modules and custom services.


Where to next

SectionDescription
ModulesUnderstand how modules use storage for file attachments
Service ExtensionBuild custom services that interact with storage
Flux Events and ScriptsGenerate and store content using event-driven scripts