OneDrive Business icon

OneDrive Business

Access OneDrive Business files and folders

File → Upload

AI-generated

Summary

Uploads a file from binary data to OneDrive Business.

Inputs

  • driveType (required) — Type of drive to access: 'user' for User Drive or 'site' for Site Drive.
  • userId (required) — User principal name or ID (required when driveType is 'user').
  • siteId (required) — SharePoint site ID (required when driveType is 'site').
  • filePath (required) — Destination path in the drive (e.g., '/Documents/report.pdf'). Supports expressions like {{ $binary.data.fileName }} to use the original filename.
  • binaryPropertyName (required) — Name of the binary property containing the file data (default: 'data').

Output shape

Returns an array of items, each containing the metadata of the uploaded file in the 'json' field.

Uses Microsoft Graph API v1.0. Requires valid OAuth2 credentials for OneDrive Business. The file is uploaded to the specified path; if a file exists at that path, it will be replaced.

Examples

Example 1: Upload a file received from a previous node (e.g., HTTP Request) to a user's OneDrive.

Set driveType to 'user', provide the userId (e.g., 'user@contoso.com'), set filePath to '/Documents/{{ $binary.data.fileName }}', and keep binaryPropertyName as 'data'.

Links

Discussion