Skip to main content


A control that allows you to use the native file explorer to pick single or multiple files, with extensions filtering support and upload.


In Linux, the FilePicker control depends on Zenity when running Flet as an app. This is not a requirement when running Flet in a browser.

To install Zenity on Ubuntu/Debian run the following commands:

sudo apt-get install zenity


Live example

Pick multiple files

import flet as ft

def main(page: ft.Page):
def pick_files_result(e: ft.FilePickerResultEvent):
selected_files.value = (
", ".join(map(lambda f:, e.files)) if e.files else "Cancelled!"

pick_files_dialog = ft.FilePicker(on_result=pick_files_result)
selected_files = ft.Text()


"Pick files",
on_click=lambda _: pick_files_dialog.pick_files(

All dialog modes

Source code

Upload multiple files

Source code



Allow picking files with specified extensions only.

The value of this property is a list of strings, e.g. ["pdf", "svg", "jpg"].


Allow selecting multiple files.


Can be optionally set on desktop platforms to set the modal window title. It will be ignored on other platforms.


Works for "Save file" dialog only. Can be set to a non-empty string to provide a default file name.


Allow to pick files of specific group.

Property value is FilePickerFileType enum with the following values:

  • ANY (default) - any file
  • CUSTOM - only files with extensions from allowed_extensions list


Can be optionally set to an absolute path to specify where the dialog should open. Only supported on Linux, macOS, and Windows.


Result is set when the dialog is closed.

The value of this property is an instance of FilePickerResultEvent class:

  • path - result of "Save file" or "Get directory path" dialogs: selected file path or directory path respectively. None if dialog was cancelled.
  • files result of "Pick files" dialog: a list of FilePickerFile class instances. None if dialog was cancelled.

FilePickerFile class properties:

  • name - file name without a path.
  • path - full path to a file. Works for desktop and mobile only. None on web.
  • size - file size in bytes.



Selects a directory and returns its absolute path.

You could either set the following file picker properties or provide their values in the method call:

  • dialog_title
  • initial_directory


Retrieves the file(s) from the underlying platform.

You could either set the following file picker properties or provide their values in the method call:

  • dialog_title
  • initial_directory
  • file_type
  • allowed_extensions
  • allow_multiple


Opens a save file dialog which lets the user select a file path and a file name to save a file.

This function does not actually save a file. It only opens the dialog to let the user choose a location and file name. This function only returns the path to this (non-existing) file in FilePicker.result.path property.

This method is only available on desktop platforms (Linux, macOS & Windows).

You could either set the following file picker properties or provide their values in the method call:

  • dialog_title
  • file_name
  • initial_directory
  • file_type
  • allowed_extensions

To save a file from the web, you don't need to use the FilePicker object.

You can instead provides an API endpoint /download/:filename that returns the file content, and then use page.launch_url to open the url, which will trigger the browser's save file dialog.

Take FastAPI as an example, you can use the following code to implement the endpoint:

from fastapi import FastAPI, Response
from fastapi.responses import FileResponse

app =

def download(filename: str):
path = prepare_file(filename)
return FileResponse(path)

and then use page.launch_url("/download/myfile.txt") to open the url, for instance, when a button is clicked.

ft.ElevatedButton("Download myfile", on_click=lambda _: page.launch_url("/download/myfile.txt"))


Uploads selected files to specified upload URLs.

Before calling upload pick_files() must be called, so the internal file picker selection is not empty.

Method arguments:

  • files - a list of FilePickerUploadFile class instances.

Each list item specifies which file should be uploaded to the upload URL with PUT (default) or POST method.

  • name
  • upload_url
  • method (PUT (default), POST)

upload_url is, generally, a presigned URL (like AWS S3 object upload URL).

For built-in upload storage a signed upload URL can be generated with the following call:

upload_url = page.get_upload_url("dir/filename.ext", 60)

First argument is a relative to upload storage path. Second argument is a URL time-to-live in seconds.

To enable built-in upload storage provide upload_dir argument to call:, upload_dir="uploads")



Fires when file picker dialog is closed.

Event object is an instance of FilePickerResultEvent class. See FilePicker.result for class properties.


Fires when a file upload progress is updated.

Event object is an instance of FilePickerUploadEvent class:

  • file_name
  • progress - a value from 0.0 to 1.0.
  • error