> For the complete documentation index, see [llms.txt](https://docs.visualyze.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.visualyze.ai/integrations/office-365/activities/files/upload-file.md).

# Upload File

Uploads a file to OneDrive or SharePoint.

This activity uploads a user-specified file in the local system to OneDrive or SharePoint using the Microsoft Graph [Resumable upload](https://docs.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0) API.

### Input

* **Connection Id:** [`GraphServiceClient Variable`](/getting-started/rpa-studio/variables.md#graphserviceclient) <mark style="color:red;">`Required`</mark>\
  Specifies the office 365 connection id.
* **Destination:** [`Object Argument`](/getting-started/rpa-studio/arguments.md#string)  <mark style="color:red;">`Required`</mark>\
  Specifies the parent folder to which the file is to be uploaded as a DriveItem. If the property is left blank then by default the root folder is used. We can also specify the output variable of the [Find Files And Folders](/integrations/office-365/activities/files/find-files-and-folders.md) activity (which is **First** or **Results**) directly as input in this property. If we are using the **Results** property of the **Find Files And Folders** activity then we can directly specify the element in the array.\
  For example : Results\[1].
* **Local FilePath:** [`String Argument`](/getting-started/rpa-studio/arguments.md#string)  <mark style="color:red;">`Required`</mark>\
  Specifies the path of a local file that is to be uploaded.
* **Cloud FileName:** [`String Argument`](/getting-started/rpa-studio/arguments.md#string)\
  Specifies the new name for the uploaded file. This property is **Optional**, we can use the existing filename by leaving the property field empty.
* **Conflict Behavior:**\
  Specifies a conflict resolution behavior in a case where there already exists a file with the same name as the file to upload. The available options are:
  * **Replace**
  * **Fail**
  * **Rename**
* **Metadata:**[`DataTable Variable`](/getting-started/rpa-studio/variables.md#datatable)\
  Specifies the metadata associated with the resultant DriveItem.This works only for a DriveItem stored in Sharepoint Document Library. Should provide DataTable variable as input.

### Output

* **Result:**[`DriveItem Variable`](/getting-started/rpa-studio/variables.md#driveitem) <mark style="color:red;">`Required`</mark>\
  Specifies the uploaded file as a DriveItem.

###

.
