# WriteSFTPFile

Description

Enables you to write data to any of the three types of Azure Blob Storage (ABS) blobs—block blobs, append blobs, and page blobs—in a container.

{% hint style="info" %}

* Ensure that you have a properly configured SFTP connection resource set up under the Resources folder.
* SFTP file names are typically case-sensitive; therefore, abc.JPG, abc.jpg, and ABC.jpg will be saved as different files. To ensure consistency, we recommend using lower-case file names and extensions: abc.jpg.
  {% endhint %}

## Configuration

| Field                          | Required | Description                                                                                                                                                                                                                                                                                                              | Example                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name                           | Required | The name of the activity. This name must be unique in a workflow.                                                                                                                                                                                                                                                        | Send Finalized Image to ABS                                                                                                                                                                                                                                                                                                                                            |
| Description                    | Optional | The description of the activity. We recommend you make this as clear as possible to guide execution, foster understanding, and support collaboration.                                                                                                                                                                    | Writes the finalized image to ABS once the employee finalizes and saves their profile picture in the HRMS.                                                                                                                                                                                                                                                             |
| Resource                       | Required | A predefined resource for accessing ABS blobs.                                                                                                                                                                                                                                                                           | /Resources/ABSConnection                                                                                                                                                                                                                                                                                                                                               |
| Container Name                 | Required | The name of the container in ABS.                                                                                                                                                                                                                                                                                        | user-profile-images                                                                                                                                                                                                                                                                                                                                                    |
| File Path                      | Required | <p>The location of the virtual directory that contains the blob to which you want to write.</p><p><strong>Note</strong></p><p><em>While entering the path, only include the virtual directories without adding the container name, because the container name is already specified (see Container Name, above).</em></p> | <p>For example, consider the following complete path:</p><p><code>user-profile-images/2024/01/15</code></p><p>In this complete path:</p><ul><li><code>user-profile-images</code> is the blob container.</li><li><code>15</code> is the virtual directory that contains the blob you want to update.</li><li><code>2024/01/15</code> is the path to the blob.</li></ul> |
| File Name                      | Required | The name of the blob file.                                                                                                                                                                                                                                                                                               | 005321\_JohnWSmith1.png                                                                                                                                                                                                                                                                                                                                                |
| Encryption Type                | Optional | The type of encryption that you want Azure to use when it stores the blob file.                                                                                                                                                                                                                                          | PGP                                                                                                                                                                                                                                                                                                                                                                    |
| Encryption Resource            | Optional | The resource that you want to use for encryption.                                                                                                                                                                                                                                                                        | DocTestPGPKey                                                                                                                                                                                                                                                                                                                                                          |
| Content Type                   | Optional | The content type of the file you want to write.                                                                                                                                                                                                                                                                          | BINARY                                                                                                                                                                                                                                                                                                                                                                 |
| Compression Type               | Optional | If you want to use compression, specify the format that you want to use.                                                                                                                                                                                                                                                 | ZIP                                                                                                                                                                                                                                                                                                                                                                    |
| Create container if Not Exists | Optional | <p>Instructs the application to create a container with the specified name if it doesn’t exist.</p><p><strong>Note</strong></p><p><em>Your account must have the access required to create a container.</em></p>                                                                                                         | Deselected                                                                                                                                                                                                                                                                                                                                                             |
| Overwrite                      | Optional | Instructs the application to overwrite the existing file.                                                                                                                                                                                                                                                                | Deselected                                                                                                                                                                                                                                                                                                                                                             |
| Append                         | Optional | Instructs the application to append the blob content to the blob file already present in ABS.                                                                                                                                                                                                                            | Deselected                                                                                                                                                                                                                                                                                                                                                             |

<figure><img src="https://3150268419-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVvyIzXhljwsvkXUekYmw%2Fuploads%2F2l6ECWlwyb0aaaQnbQGt%2FWriteABSFile.png?alt=media&#x26;token=717c686d-4225-4165-b18a-cf3355e51ff8" alt=""><figcaption></figcaption></figure>

## Input

| Field           | Required  | Data Type | Description                                                                                                                                                                                                      | Example               |
| --------------- | --------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
| blobpath        | Mandatory | String    | The location of the virtual directory (without the container name) that contains the blob to which you want to write.                                                                                            | `files/user-uploads`  |
| blobName        | Mandatory | String    | The name of the blob to which you want to write.                                                                                                                                                                 | `report_20240417.pdf` |
| createContainer | Optional  | Boolean   | <p>Instructs the application to create a container with the specified name if it doesn’t exist.</p><p><strong>Note</strong></p><p><em>Your account must have the access required to create a container.</em></p> | `True`                |

## Output

| Field         | Required | Data Type | Description                                                                                                                                                                                        | Example                               |
| ------------- | -------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------- |
| schema        | Required | NA        | A JSON schema describing the structure of the data written to the blob (if applicable). This is especially useful if the content being written is structured data that can be represented as JSON. | NA                                    |
| contentLength | Required | Number    | The size of the written blob in bytes. This corresponds to the `Content-Length` of the created blob in Azure Blob Storage.                                                                         | `125890` (representing 125,890 bytes) |
| fileName      | Required | String    | The final name of the blob created in Azure Blob Storage.                                                                                                                                          | `report_20240417.pdf`                 |
| path          | Required | String    | The location of the virtual directory (without the container name) that contains the blobs to which the application wrote.                                                                         | `files/user-uploads`                  |
