# Upload/download

### Download file by url to file system <a href="#download-file-by-url-to-file-system" id="download-file-by-url-to-file-system"></a>

Downloads a single file by server relative url to file system.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter           | Description                                                                                                                                                                      |
| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Server relative url | An url relative to server, e.g. "/subsite/doclib/folder/file.txt".                                                                                                               |
| Local filename      | Full path where to download file. Note that the user the application pool running Flow Server must have write access to the file. If the file already exists, it is overwritten. |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not.

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description        |
| ---------- | ------------------ |
| 1000       | Unspecified error. |

### Download file by url to stream <a href="#download-file-by-url-to-stream" id="download-file-by-url-to-stream"></a>

Downloads a single file by server relative url to a simple variable (stream).

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter           | Description                                                        |
| ------------------- | ------------------------------------------------------------------ |
| Server relative url | An url relative to server, e.g. "/subsite/doclib/folder/file.txt". |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not. If succesful, result of operation is stored in Results member

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |
| Results      | Simple variable containing the results of operation                    |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description        |
| ---------- | ------------------ |
| 1000       | Unspecified error. |

### Download file to file system <a href="#download-file-to-file-system" id="download-file-to-file-system"></a>

Downloads a single file from Document Library by path to file system.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter             | Description                                                                                                                                                                      |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Document Library Name | Name of Document Library in SharePoint (not id)                                                                                                                                  |
| Remote filename       | Remote filename in Document Library, including any extensions or folders if applicable. E.g. "file.txt" or "subfolder1/subfolder2/file.txt"                                      |
| Local filename        | Full path where to download file. Note that the user the application pool running Flow Server must have write access to the file. If the file already exists, it is overwritten. |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not.

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description        |
| ---------- | ------------------ |
| 1000       | Unspecified error. |

### Download file to stream <a href="#download-file-to-stream" id="download-file-to-stream"></a>

Downloads a single file to a simple variable (stream).

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter             | Description                                                                                                                                 |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| Document Library Name | Name of Document Library in SharePoint (not id)                                                                                             |
| Filename              | Remote filename in Document Library, including any extensions or folders if applicable. E.g. "file.txt" or "subfolder1/subfolder2/file.txt" |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not. If succesful, result of operation is stored in Results member

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |
| Results      | Simple variable containing the results of operation                    |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description        |
| ---------- | ------------------ |
| 1000       | Unspecified error. |

### Upload file from bytes <a href="#upload-file-from-bytes" id="upload-file-from-bytes"></a>

Uploads a single file from a Table of bytes to a SharePoint Document Library.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter             | Description                                                                                                                                        |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Source bytes          | Table (consisting of bytes) to read from                                                                                                           |
| Document Library Name | Name of Document Library in SharePoint (not id)                                                                                                    |
| Filename              | Remote filename to use in Document Library, including any extensions or folders if applicable. E.g. "file.txt" or "subfolder1/subfolder2/file.txt" |
| Overwrite if exists   | Specifies whether to overwrite remote file if it already exists or abort                                                                           |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not.

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description        |
| ---------- | ------------------ |
| 1000       | Unspecified error. |

### Upload file from local file system <a href="#upload-file-from-local-file-system" id="upload-file-from-local-file-system"></a>

Uploads a single file from file system to a SharePoint Document Library.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter             | Description                                                                                                                                        |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Local filename        | Full path to file to upload. Note that the user the application pool running Flow Server must have access to the file.                             |
| Document Library Name | Name of Document Library in SharePoint (not id)                                                                                                    |
| Remote filename       | Remote filename to use in Document Library, including any extensions or folders if applicable. E.g. "file.txt" or "subfolder1/subfolder2/file.txt" |
| Overwrite if exists   | Specifies whether to overwrite remote file if it already exists or abort                                                                           |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not.

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description        |
| ---------- | ------------------ |
| 1000       | Unspecified error. |

### Upload file from stream <a href="#upload-file-from-stream" id="upload-file-from-stream"></a>

Uploads a single file from a stream to a SharePoint Document Library.

#### Parameters <a href="#parameters" id="parameters"></a>

| Parameter             | Description                                                                                                                                        |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Source stream         | Simple variable containg a stream                                                                                                                  |
| Document Library Name | Name of Document Library in SharePoint (not id)                                                                                                    |
| Filename              | Remote filename to use in Document Library, including any extensions or folders if applicable. E.g. "file.txt" or "subfolder1/subfolder2/file.txt" |
| Overwrite if exists   | Specifies whether to overwrite remote file if it already exists or abort                                                                           |

#### Output <a href="#output" id="output"></a>

Record with information about whether operation failed or not.

| Member       | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| HasFailed    | Whether operation has failed or not                                    |
| ErrorMessage | A description of the failure, if any                                   |
| ErrorCode    | An error code related to operation failure. Is 0 if no failure occured |

#### Errors <a href="#errors" id="errors"></a>

| Error code | Description        |
| ---------- | ------------------ |
| 1000       | Unspecified error. |
