File Picker

The File Picker action allows users to select a file from their device. This action supports filtering by file type, setting size limits, and optionally showing a toast after selection.

Properties

Property
Type
Required
Description

File Type

Dropdown

No

Select allowed file type: "audio", "pdf", or any for any file type.

Size Limit

number

No

Maximum file size allowed in KB. Files exceeding this limit are filtered out.

Show Toast

boolean

No

Whether to show a toast notification for files exceeding size limit. Defaults to true.

File Variable

Dropdown

No

Select variable where the selected file will be stored.

Use Cases

  • Document Upload: Allow users to upload PDFs, documents, or certificates

  • Audio Files: Select music files, voice recordings, or podcasts

  • Form Attachments: Attach files to forms, applications, or messages

  • Media Libraries: Build collections of user-uploaded content

  • Data Import: Allow users to import data files for processing

Default Behavior

By default:

Behavior
Description

File Types

All file types allowed if File Type not specified

Selection Mode

Single file selection

Size Limits

No size restrictions if Size Limit not specified

Toast Display

Shows size limit warnings unless Show Toast is false

File Storage

Selected file stored in specified File Variable variable

User Cancellation

Action completes without error if user cancels picker

How to Use

Call External Method action configuration showing message name and payload fields
Call External Method action configuration in Digia Studio
  1. Attach the action to a widget event (button tap, icon press, etc.)

  2. Select File Picker from the action list

  3. Optionally specify File Type to restrict file types

  4. Set Size Limit in KB to restrict file sizes

  5. Specify File Variable variable to store selected file

Implementation Details

The action uses the file_picker package to access device file systems. Selected files are converted to AdaptedFile objects containing file data, metadata, and size information.

Size limits are enforced in KB (converted to bytes internally). Files exceeding the limit are automatically filtered out, and users see toast notifications when Show Toast is enabled.

  • Image Picker - Select images and videos with camera/gallery options

  • Upload - Upload selected files to a server

  • Set State - Update UI state with selected files


Last updated