Skip to content

Added File Download [Action] #203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/ff-concepts/file-handling/clear-delete-media.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Clear or Delete Media
slug: /concepts/file-handling/clear-delete-media
sidebar_position: 6
sidebar_position: 7
tags: [Media, Action]
keywords: [Media, Clear Data, Delete Data Firebase Storage, Supabase Storage]
---
Expand Down
56 changes: 56 additions & 0 deletions docs/ff-concepts/file-handling/download-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
title: Download File
slug: /concepts/file-handling/download-file
sidebar_position: 6
tags: [Media, Download Data, File Management]
keywords: [Media, Download Data, Firebase Storage, Supabase Storage]
description: Learn how to add download file action into your FlutterFlow app.
---

# Download File

The **Download File** action allows you to enable users to download or save files locally on their devices.

<div style={{
position: 'relative',
paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding
height: 0,
width: '100%'}}>
<iframe
src="https://demo.arcade.software/dhlZ7J8kDFNDypyv5TcO?embed&show_copy_link=true"
title=""
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
height: '100%',
colorScheme: 'light'
}}
frameborder="0"
loading="lazy"
webkitAllowFullScreen
mozAllowFullScreen
allowFullScreen
allow="clipboard-write">
</iframe>
</div>
<p></p>

:::tip[File Download Location]
- **Windows, macOS, Linux, and Web**: Files are saved in the **Downloads** folder by default.
- **iOS**: Files are downloaded in the **Application Documents Directory**.
- **Android**: Files are saved in the application's directory at `Android/data/your.package.name/files/your_file.extension`.

:::

## Add Download File [Action]

To add a download file action, select the **Widget** (e.g., button or any interactive widget) where you want users to initiate the file download and set the **Source** to one of the following.

- **From URL**: Use this option for downloading files that are accessible through a direct link and specify the URL of the file that should be downloaded.
- **From File (Bytes)**: Use this option when the file is uploaded to the device using the [Local Upload (Widget State)](upload-data.md#local-upload-widget-state). You can access the file via ***Widget State > Uploaded Local File***.

Optionally, you can specify a **Filename** to be used when the file is downloaded.

![file-download-action](imgs/file-download-action.avif)
Binary file not shown.