Upload file
Upload a local file of any size to a OneDrive or SharePoint folder path; creates or replaces it. Files over 4 MB go through a resumable upload session in chunks.
Command in the Microsoft 365 toolkit · id ooa.microsoft365/upload_file · 7 inputs (2 required), 3 outputs
Inputs
| Input | Type | Required | Default | What it is |
|---|---|---|---|---|
| Access token | Credential | No | Microsoft Graph access token from the vault; or leave it empty and choose a connection that signs in, which gets and renews the token. | |
| Local path | File | Yes | File to upload. | |
| Remote path | String | Yes | Target path in the drive, including the file name; ending with / it is a folder and the file keeps its name (G3). | |
| If exists | String | No | replace | When the name is taken at the destination: fail, rename (add a number) or replace. |
| Drive | String | No | me/drive | Whose files: me/drive (your OneDrive), a person (ann@acme.com), a SharePoint site (contoso.sharepoint.com:/sites/Finance), a library of a site by name (contoso.sharepoint.com:/sites/Finance:/Invoices), or sites/{site-id}/drive or drives/{drive-id}. With an app sign-in, name a person or site. |
| Endpoint address | String | No | https://graph.microsoft.com/v1.0 | Graph endpoint; change only for national clouds or testing. |
| Chunk size (MB) | Number | No | 10 | Size of each piece sent for files over 4 MB (rounded down to a multiple of 320 KB); smaller pieces suit slow or unreliable networks. |
Outputs
| Output | Type | What it is |
|---|---|---|
| item_id | String | Drive item id. |
| web_url | String | Link to the file. |
| size | Number | Bytes uploaded. |