Upload File
Definition
The Upload File action in OneDrive enables you to seamlessly upload files from your workflows directly into your OneDrive account. It supports uploading files up to 15 MB in size and allows you to fully control the file’s name and destination folder. Whether you want to upload documents generated within your flow, move files between systems (e.g., from Google Drive to OneDrive), or centralize data storage, this action ensures that your files are reliably transferred and easily accessible.
Key capabilities include:
- Uploading files from dynamic sources (e.g., files retrieved in earlier steps of your flow).
- Defining a custom file name in OneDrive.
- Selecting the destination folder by browsing through OneDrive, providing a folder ID, or specifying a folder path.
- Returning detailed metadata about the uploaded file (e.g., file ID, path, web link, MIME type, and size) for further use in downstream automation steps.
Example Use Case
1. Transfer Files from Google Drive to OneDrive
Automatically fetch a file from Google Drive (e.g., via the “Find File/Folder” action) and upload it to a specified folder in OneDrive for central storage.
2. Archive Reports in OneDrive
Save automatically generated reports, invoices, or logs from your flow into OneDrive for long-term storage and easy access.
3. Shareable File Uploads
Upload a file to OneDrive and immediately use the generated Web URL or Download URL to share with colleagues or external stakeholders.
4. Organize Uploaded Documents
Upload files into structured OneDrive folders (e.g., /Finance/2025/Invoices/
) to maintain consistent organization across your workflows.
5. Cross-System File Integration
Move files from external systems (e.g., email attachments, databases, or APIs) into OneDrive to consolidate data and ensure team-wide access.
🔹 Inputs
1. Connection
The authenticated OneDrive account that the action will use to upload the file.
- This defines which OneDrive environment (personal or business) the file will be stored in.
- Example: If you connect using your Microsoft 365 work account, the file will be uploaded into your company’s OneDrive environment.
2. File Payload
The actual file content (binary data) that you want to upload.
- You can retrieve the payload from other actions in your flow, such as “Find File/Folder” in Google Drive, or even from email attachments and form submissions.
- Size Limit: Maximum of 15 MB per upload. For larger files, consider using chunked upload methods (not supported in this simple action).
- Example: A PDF generated earlier in your flow is passed here as the payload to be uploaded to OneDrive.
3. File Name
The name that will be given to the uploaded file in OneDrive.
- You can either hardcode a static name (e.g.,
Report.pdf
) or dynamically generate one using tokens from earlier steps (e.g.,Invoice_{{Form.SubmissionDate}}.pdf
). - If a file with the same name already exists in the chosen folder, OneDrive will typically create a new version unless explicitly handled otherwise.
4. Selecting Destination Folder
Defines where in OneDrive the file will be uploaded. You have two options:
a. Selecting through OneDrive UI:
- By clicking the field, your OneDrive will pop up and allow you to visually pick the destination folder. This is user-friendly and avoids errors with IDs or paths.
b. Specifying Folder by ID or Path:
-
If you want to configure dynamically (using tokens or hardcoding), you can specify the folder either by ID or Path.
- Folder ID Example:
1EED600A8F0FD9A1!s75181466e59d4bacb1ec55930b932ed1
- Folder Path Example:
/drive/root:/Pictures/
- Folder ID Example:
👉 Important:
- If “Select By Path” option is enabled, provide the Path.
- If it’s disabled, you must provide the ID.
- Using path is often easier for readability (
/drive/root:/Invoices/2025/
), but ID is more reliable if folder names change.
✅ Summary Tip for Inputs:
- Connection: Choose the right OneDrive account.
- File Payload: Supply the actual file data (up to 15 MB).
- File Name: Name it smartly (static or dynamic).
- Destination Folder: Pick it via UI or define ID/Path depending on your flow needs.
🔹 Outputs
When a file is successfully uploaded, the action returns detailed information about the file. These outputs can be used in later steps of your flow (e.g., sharing the file, storing its link in a database, or sending it via email).
1. File ID
A unique identifier automatically generated by OneDrive for the uploaded file.
- This ID is permanent for the file and can be used in later actions (e.g., move, copy, update, or share the file).
- Example:
01BXYR7C3ZVDZ7YFTHWZE6C2N3PJSKJHHO
2. Name
The file name as stored in OneDrive.
- Usually matches the name you specified in the File Name input, but if a file with the same name already existed, OneDrive may apply versioning rules.
- Example:
MonthlyReport_July2025.pdf
3. File Path
The full path of the uploaded file in OneDrive.
- This indicates where the file resides in the folder structure.
- Helpful for referencing files directly without relying on IDs.
- Example:
/drive/root:/Reports/2025/MonthlyReport_July2025.pdf
4. Web URL
A link to open the file in the OneDrive web interface.
- Useful if you want to give a user-friendly way for team members to access or view the file directly in OneDrive.
- Example:
https://onedrive.live.com/edit.aspx?resid=01BXYR7C3ZVDZ7YFTHWZE6C2N3PJSKJHHO
5. Download URL
A direct, pre-authenticated URL for downloading the file.
- Unlike the Web URL, this link allows applications or users to directly fetch the file’s binary content without logging in again.
- Very useful for automation scenarios (e.g., sending the file as an attachment in an email).
- Example:
https://api.onedrive.com/v1.0/drive/items/01BXYR7C3ZVDZ7YFTHWZE6C2N3PJSKJHHO/content
6. MIME Type
Indicates the file format using the standard MIME (Multipurpose Internet Mail Extensions) notation.
-
Helps your flow identify the type of file for further processing.
-
Examples:
- PDF →
application/pdf
- Word →
application/vnd.openxmlformats-officedocument.wordprocessingml.document
- Image →
image/png
- PDF →
7. Size
The total size of the uploaded file in bytes.
- Can be used for logging, validation, or enforcing file-size restrictions in your flows.
- Example:
1536000
(≈ 1.5 MB)
✅ Customer Tip: These outputs are not just information — they can be reused in your automation. For example, you can:
- Store the File Path in a SharePoint list for record keeping.
- Share the Web URL with colleagues in an approval email.
- Use the Download URL to fetch and attach the file in another system.
📌 Example Scenario: Uploading a File from Google Drive to OneDrive
Imagine your team works across Google Drive and OneDrive, and you need to automatically transfer a file (like a report) from Google Drive to OneDrive for central storage and sharing.
Here’s how you would set it up in Zenphi:
1. Find the File in Google Drive
- Use the Find File/Folder action in the Google Drive category to locate the file you want to transfer (for example,
MonthlyReport_July2025.pdf
). - This action will return the File Payload (the actual file content) along with details like file name and ID.
2. Upload the File to OneDrive
-
Add the Upload File (OneDrive) action.
-
In the File Payload field, map the payload output from the previous Google Drive action.
-
In File Name, enter either a fixed name (e.g.,
MonthlyReport_July2025.pdf
) or dynamically pass the file name from the Google Drive step. -
For Destination Folder:
- If you want to store it in a specific folder (e.g.,
/drive/root:/Reports/2025/
), select "By Path" and enter that path. - Alternatively, select the folder directly by clicking through your OneDrive popup.
- If you want to store it in a specific folder (e.g.,
3. Leverage Outputs in Next Steps
After upload, you’ll get several useful outputs (File ID, Path, Web URL, Download URL, etc.). You can:
- Use the Web URL in an email notification to let your team know the report is available.
- Store the File Path in a SharePoint list for tracking.
- Use the Download URL if you need to attach the file in another automated process.
✅ End Result: Your flow automatically fetches the file from Google Drive and uploads it to OneDrive in the correct folder. The team then receives an email with the OneDrive link to access the file instantly — no manual download/upload required.
Updated about 19 hours ago