Download media
Function: Download media
This function allows you to enable your application's users to download a specific file directly from your media library to their device. It's useful for providing access to documents, images, reports, or any other files stored within your platform.
Input
- Media ID (Text): This is the unique identifier for the specific file you want users to download from your media library. This input is required.
- File name (Text): This is the name that will be given to the file when it is downloaded by the user. For example, if you provide "MyReport.pdf", the user will download a file with that name. If you leave this blank, the downloaded file will be named "FILE" by default.
Output
This function does not produce any direct output within your application. Instead, it triggers a download action in the user's web browser, causing the specified file to be saved to their device.
Execution Flow
Real-Life Examples
Here are some practical ways you can use the "Download media" function:
-
Downloading a Product Brochure:
- Scenario: You have a product page, and you want users to be able to download a detailed brochure about the product.
- Inputs:
- Media ID:
product_brochure_xyz123(The unique ID of your brochure file in the media library) - File name:
Product_Brochure_Latest.pdf
- Media ID:
- Result: When a user clicks a "Download Brochure" button, their browser will download a file named "Product_Brochure_Latest.pdf" containing the brochure.
-
Accessing a User Manual:
- Scenario: After a user registers for your service, you want to offer them a link to download the user manual.
- Inputs:
- Media ID:
user_manual_v2_0(The unique ID of the user manual file) - File name:
MyService_User_Manual.docx
- Media ID:
- Result: The user's browser will download a file named "MyService_User_Manual.docx" to their computer.
-
Downloading an Image with a Default Name:
- Scenario: You have a gallery of images, and you want to allow users to download a specific image without needing to specify a custom name for each.
- Inputs:
- Media ID:
gallery_image_sunset_456(The unique ID of the sunset image) - File name: (Left blank, using the default)
- Media ID:
- Result: The user's browser will download the image file, and it will be named "FILE" (or potentially "FILE.jpg" depending on browser behavior and file type) on their device.