Download File
Definition
The Download File action enables you to download a specific file from OneDrive by using its public URL or direct reference. This action retrieves the file’s content along with essential metadata such as file name, size, and MIME type, allowing you to seamlessly integrate file download capabilities into your automation workflows. Key capabilities include flexible file selection via OneDrive connection, support for specifying files by ID or path, and extraction of complete file content for further processing or storage.
Example Use Cases
-
Automated Report Retrieval Automatically download daily or weekly reports stored in OneDrive for further processing or archival.
-
Content Processing Workflow Download files like documents or images from OneDrive to analyze or transform their content in other connected apps.
-
Backup and Sync Automatically download and save important files from OneDrive to a local or cloud backup system.
-
Sharing File Content Retrieve and extract file content from OneDrive to share it in emails, messages, or other platforms.
-
File Conversion Preparation Download files to prepare them for format conversion or data extraction using other automation actions.
Inputs
- ConnectionThis field requires your authenticated OneDrive connection, which enables secure access to your OneDrive account. By linking your account here, the action can access your files and download them on your behalf without needing repeated sign-ins.
-
Selecting File This input specifies the exact file in OneDrive that you want to download. You have multiple ways to provide the file identifier for flexibility and ease of use:
-
OneDrive Sign-In Selection: Click the sign-in field to open your OneDrive interface where you can visually browse and select the desired file directly. This is ideal if you prefer a user-friendly, graphical way to pick the file.
-
Hardcoding or Token Picker: Alternatively, you can manually enter the file's unique identifier (ID) or path from previous workflow steps. This method is useful for automated flows where the file ID/path is dynamically determined or retrieved from earlier actions.
-
Select By Path Option: Depending on whether this option is enabled or disabled:
- If disabled, you must provide the file ID (e.g.,
1EED600A8F0FD9A1!s75181466e59d4bacb1ec55930b932ed1
). - If enabled, you can provide the full path to the file in OneDrive (e.g.,
/drive/root:/Pictures/Screenshot 2023-05-10 125216.png
).
- If disabled, you must provide the file ID (e.g.,
Using paths is often more human-readable, while IDs guarantee exact file targeting, especially when files might have duplicate names.
-
Outputs
- File Name This output provides the exact name of the downloaded file as it exists in OneDrive. Knowing the file name is essential for identifying the file within your workflow or when saving it locally or in another system.
- File Content This field contains the actual binary content or data stream of the file you downloaded. It represents the full content of the file, allowing you to use it in subsequent actions, such as saving the file elsewhere, processing its data, or sending it as an attachment.
- Size This output indicates the total size of the downloaded file, usually expressed in bytes. It helps you confirm the file's dimensions and can be useful for validating whether the entire file was successfully retrieved or for applying size-based logic in your workflow.
- MIME Type The MIME type specifies the file’s content format using a standardized identifier (such as
application/pdf
for PDFs orimage/png
for PNG images). This information is critical for correctly handling, processing, or rendering the file in downstream actions or applications, ensuring that the file is interpreted appropriately.
Example: Downloading a Project Report for Local Processing
Imagine you work in a marketing team and regularly receive updated project reports stored in OneDrive. You want to automate downloading the latest report file so that it can be processed by another system or sent via email.
How to set it up:
-
Connection: First, connect your OneDrive account to authorize access to your files.
-
Selecting File: Use the OneDrive sign-in popup to navigate and select the exact report file you want to download, for example,
/drive/root:/Reports/Project_Update_May.pdf
. Alternatively, you can hardcode the file ID or path if known, or use a token from a previous step. -
Run the Flow: When the flow runs, the action downloads the file content, along with metadata such as the file name, size, and MIME type.
-
Next Steps: Use the File Content output to save the report locally, attach it to an email, or pass it to another system for processing, like generating a summary or extracting data.
This setup automates the manual task of locating and downloading the latest report, improving efficiency and accuracy.
Updated 1 day ago