> For the complete documentation index, see [llms.txt](https://docs.frends.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.frends.com/tasks/tasks/google-drive/upload.md).

# Upload

Task version: 1.1.0

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.GoogleDrive>

## Task Parameters

{% tabs %}
{% tab title="Input" %}

| Name                               | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SourceDirectory : `String`         | <p>Source directory.</p><p><br>Default: <code>-</code><br>Example: <code>c:\temp, \network\folder</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| FileMask : `String`                | <p>Windows-style filemask. Empty field = all objects (<em>).</em></p><p><em>If you want to upload only one file, define exact filename as filemask.</em></p><p><em>Consider using .zip (for example) when uploading multiple objects at the same time.</em></p><p><br><em>Default:</em><br>Example: <em><code>.</code></em><code> , ?</code><em><code>file.*, foo</code></em><code>*.txt, singlefile.txt</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                       |
| TargetFolderId : `String`          | <p>Id of the target Google Drive folder.</p><p><br>Default: <code>-</code><br>Example: <code>42o3j8D7cmhMJFAAlbZb5B\_8u9OqnAIkn</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| 🗝ServiceAccountKeyJSON : `String` | <p>The JSON service account key generated in the Google Cloud portal.</p><p>Value can be either JSON string or full filepath to JSON file.</p><p><br>Default: <code>-</code><br>Example: <code>{ "type": "service\_account", "project\_id": "something", "private\_key\_id": "fdsafdsafdsalmnop12345678909876543212344", "private\_key": "-----BEGIN PRIVATE KEY-----\nMIIE.......Hw==\n-----END PRIVATE KEY-----\n", "client\_email": "<someone@something.iam.gserviceaccount.com>", "client\_id": "123456789012345678900", "auth\_uri": "<https://accounts.google.com/o/oauth2/auth>", "token\_uri": "<https://oauth2.googleapis.com/token>", "auth\_provider\_x509\_cert\_url": "<https://www.googleapis.com/oauth2/v1/certs>", "client\_x509\_cert\_url": "<https://www....nt.com>" } , C:\temp\ServiceAccountKeyJSON.json</code></p> |
| IncludeSharedDrives : `Boolean`    | <p>Whether to enable support for shared drives.</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| {% endtab %}                       |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

{% tab title="Options" %}

| Name                            | Description                                                                                                                                                                                                                                                  |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| ThrowErrorOnFailure : `Boolean` | <p>Value indicating whether upload error should stop the Task and throw an exception (true) or try to add the error message to Result.ErrorMessages and continue to upload next file.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p> |
| ThrowErrorIfNoMatch : `Boolean` | <p>Throw error if there are no file(s) in the path matching the filemask.</p><p><br>Default: <code>-</code><br>Example: <code>false</code></p>                                                                                                               |
| {% endtab %}                    |                                                                                                                                                                                                                                                              |
| {% endtabs %}                   |                                                                                                                                                                                                                                                              |

## Task Result

| Name                          | Description                                                                                              |
| ----------------------------- | -------------------------------------------------------------------------------------------------------- |
| Success : `Boolean`           | <p>Gets a value indicating whether upload was executed successfully.<br>Example: <code>true</code></p>   |
| Data : `List<UploadResult>`   | <p>List of upload result(s).<br>Example: <code>{ {"id", "filename"}, {"id", filename"} }</code></p>      |
| ErrorMessage : `List<Object>` | <p>Gets error message.<br>Example: <code>{ {"An error occured..."}, {"An error occured..."} }</code></p> |

## Task Changelog

Changelog for Task Frends.GoogleDrive.Upload.

### \[1.1.0]

#### Added

* Added a flag for shared drive support in the file search

### \[1.0.1] - 2023-12-07

#### Changed

* Input.ServiceAccountKeyJSON and Result.ErrorMessage documentation update.

### \[1.0.0] - 2023-11-15

#### Added

* Initial implementation


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.frends.com/tasks/tasks/google-drive/upload.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
