Ask AI
Skip to main content

Download media

Function: Download media

This action allows you to enable your users to download a specific file directly from your application's media library. When this action is triggered, the user's browser will prompt them to save the file to their device.

Input

  • Media ID (STRING): This is the unique identifier for the file you want your users to download. You can usually find this ID when you upload or manage files in your media library.
  • File name (STRING): This is the name that will be given to the file when the user downloads it. If you don't provide a specific name, the file will be downloaded with a default name like 'FILE'.

Output

This action does not produce a direct output variable within your application. Instead, its outcome is a user-facing event: it initiates a file download in the user's web browser, allowing them to save the specified media file to their local device.

Execution Flow

Real-Life Examples

Here are some ways you can use the "Download media" action in your application:

Example 1: Downloading a Product Brochure

Imagine you have an e-commerce application and want to allow users to download a PDF brochure for a specific product.

  • Inputs:
    • Media ID: prod_brochure_12345.pdf (This ID would be linked to the PDF file in your media library)
    • File name: ProductX_Brochure.pdf
  • Result: When a user clicks a "Download Brochure" button, their browser will prompt them to save a file named ProductX_Brochure.pdf containing the product information.

Example 2: Providing a User Manual

You've built an application that helps users manage their tasks, and you want to offer a downloadable user manual.

  • Inputs:
    • Media ID: app_manual_v2.0.docx (The ID for your latest user manual document)
    • File name: MyTaskApp_UserManual_v2.0.docx
  • Result: A "Download Manual" button on your help page will trigger the download of MyTaskApp_UserManual_v2.0.docx to the user's computer.

Example 3: Downloading an Invoice

In a billing application, you might want to allow customers to download their past invoices as PDF files.

  • Inputs:
    • Media ID: invoice_customerA_2023_07.pdf (This ID would be dynamically retrieved based on the selected invoice)
    • File name: Invoice_2023-07-15_CustomerA.pdf
  • Result: When a customer views their invoice history and clicks a "Download" button next to a specific invoice, the corresponding PDF file, named Invoice_2023-07-15_CustomerA.pdf, will be downloaded to their device.