Skip to Content

File Operations

Momen supports file-related actions on Web and Native App, including upload, view, download, and bitmap export.

File actions include:

  1. Upload File
  2. View File
  3. Download File
  4. Download Bitmap

Upload File

Overview

Upload a local file to the server. Supported formats include PDF, Word, Excel, audio, and video.

  • File selection: Let users pick a file from their device
  • Format support: Common document, audio, and video types
  • Data storage: Save the result to a page variable or database
  • Status feedback: Use success/failure actions for user feedback
  • Business integration: Combine with form submission workflows

Platform differences:

PlatformBehavior
WebPick files from the system file picker; supports a wide range of formats
Native AppPick files from the device file system

Configuration

ParameterRequiredDescription
Target page variableYesFile-type page variable to store the upload result
File size limitNoMaximum file size (platform defaults apply)
On successNoActions after a successful upload (toast, database save, navigation)
On failureNoActions after a failed upload (error toast, retry)

Output

FieldDescription
File infoFile object with name, size, type, URL, etc., stored in the page variable
Upload statustrue (success) or false (failure)

Notes

  • Add a File page variable before configuring the action.
  • Only one file per upload; a new upload overwrites the previous file.
  • File preview is not supported during upload.

Examples

Resume upload

Trigger: Upload resume button Target page variable: resume_file On success: 1. Show toast "Resume uploaded" 2. Save to database via data mutation 3. Update page state On failure: Show toast "Upload failed — please retry"

Contract upload

Trigger: Upload contract button Target page variable: contract_file On success: 1. Show toast "Contract uploaded" 2. Enable submit button 3. Save file info to form data On failure: Show error and allow retry

Platform Support

  • Web
  • Native App

View File

Overview

Open and preview file content in the app. Supports PDF, Word, Excel, images, and other common formats.

  • Preview: View files inside the app
  • Local files: View files stored in page variables
  • Remote files: View files from database records via page data

Configuration

ParameterRequiredDescription
File sourceYesLocal upload (page variable) or File (database record)
File dataYesPage variable or page data field binding
File nameNoCustom display name

Output

No direct output. The action opens a file viewer.

Prerequisites

  • To view database files, configure the relevant page data source.
  • File size should not exceed 20 MB.

Examples

View uploaded resume

Trigger: View resume button File source: Local upload File data: resume_file page variable

View stored document

Trigger: View button in document list File source: File File data: document field from page data

Platform Support

  • Native App

Download File

Overview

Download a file stored in the database to the user’s local device.

Configuration

ParameterRequiredDescription
File data sourceYesPage data field binding to a file column
Download file nameNoCustom filename (defaults to original name)

Output

No direct output. Triggers the browser or system download.

Prerequisites

Configure a page data source that queries the file record.

Examples

Download report

Trigger: Download report button File data source: report_file from page data Download file name: "{report_name}_{date}.pdf"

Download contract

Trigger: Download contract button File data source: contract document field

Platform Support

  • Web

Download Bitmap

Overview

Convert a specified view region on the page into an image and download it locally.

  • View to image: Export a container or section as a bitmap
  • Content export: Capture complex layouts as images
  • Sharing: Generate images for social sharing or records

Configuration

ParameterRequiredDescription
Target view componentYesContainer component to convert
Image formatNoPNG, JPEG, etc. (default: PNG)
Image qualityNoNumber 0–1 (default: 1.0)
Download file nameNoCustom filename

Output

FieldDescription
Bitmap dataGenerated image for download or further use
Conversion statustrue (success) or false (failure)

Workflow

To download a view as an image:

  1. Add Component Operations → View → View to Image and specify the target view component ID.
  2. On success, add File Operations → Image → Download Bitmap and bind the result data.

Examples

Page screenshot

Step 1: View to Image Target: Main page container Format: PNG Step 2: Download Bitmap Trigger: Download screenshot button Bitmap data: Conversion result File name: screenshot_{timestamp}.png

Share card

Step 1: View to Image Target: Share card container Format: JPEG Quality: 0.8 Step 2: Download Bitmap Bitmap data: Conversion result Purpose: Generate a shareable card image

Platform Support

  • Web

Notes

The target view must be fully loaded before conversion for accurate results.

Last updated on