File Storage¶
By default, users cannot attach files to chat messages. To enable file uploads via drag and drop or the Attach file button, you must connect your Endpoint to a third-party storage provider.
Enabling file uploads in your Endpoint enhances the user experience by allowing seamless sharing of documents, images, and other files within the chat. Users can upload screenshots to illustrate technical issues and share various documents such as contracts, invoices, order confirmations, and photos of purchased goods.
After uploading a file to the chat interface, the file will be saved in the storage of your third-party provider and will be accessible for viewing by both the sender and the recipient in the chat.
Supported Endpoints¶
The File Storage section is supported by the following Endpoints:
Create a Connection to a File Storage Provider¶
To enable file uploads, connect to one of the following file storage providers:
- Make sure that you have access to Azure Blob Storage Container and at least one container has been created, or create a new one. Note that the container must be publicly available; otherwise, users cannot upload files via the chat interface.
- Open the Azure portal.
- In the Azure services section, select Storage Accounts.
- On the Storage accounts page, select the account from the Name column.
- In the left-side menu, navigate to Data storage > Containers. Copy the name of the target container from the Name column. This container will store user-uploaded files. Save the container name for later use.
- In the left-side menu, go to Security + networking and select Access Keys.
- On the Access Keys page, copy the name from the Storage account name field and the key from the Key field for later use.
- On the Cognigy.AI side, open the Project that contains the Endpoint for which you want to configure file uploads. In the left-side menu of the Project, select Deploy > Endpoints. On the Endpoints page, select one of the Endpoints that supports file uploads or create a new one.
- On the Endpoints Settings page, go to the File Storage section.
- From the File Storage Provider list, select Azure.
- Next to the Azure Connection, click +.
- In the New Connection window, fill in the following fields:
- Container Name — the name of the container that you copied and saved previously.
- Account — enter the storage account name that you copied and saved previously.
- Account Key — enter the key that you copied and saved previously.
- Click Create, then Save.
- Make sure that you have access to Amazon S3 Bucket and that at least one bucket has been created, or create a new one. Note that the bucket must be publicly available; otherwise, users cannot upload files via the chat interface.
- Open the Amazon S3 console.
- On the Amazon S3 page, go to the General purpose buckets tab.
- From the Name column, copy the name of the target bucket from the Name column. This bucket will store user-uploaded files. Save the bucket name for later use.
- From the AWS Region column, copy the region ID, for example,
us-east-1
, and save it for later use. - In the upper-right corner, go to your account, then select Security credentials.
- On the My Security Credentials page, go to Access keys and click Create access key.
- On the Alternatives to root user access keys page, review the security recommendations. To continue, select the checkbox, and then click Create access key. On the Retrieve access key page, your access key ID is displayed.
- Under Secret access key, click Show and then copy the access key ID and secret key from your browser window and save them for later use. Click Done. If you want to use temporary access with MFA instead of a secret key, you need a session token. To set up a session token, obtain this value via AWS API and specify the token in the
AWS_SESSION_TOKEN
variable in thevalues.yaml
file. For more information, read Using temporary credentials with AWS resources. - On the Cognigy.AI side, open the Project that contains the Endpoint for which you want to configure file uploads. In the left-side menu of the Project, select Deploy > Endpoints. On the Endpoints page, select one of the Endpoints that supports file uploads or create a new one.
- On the Endpoints Settings page, go to the File Storage section.
- From the File Storage Provider list, select AWS.
- Next to Google Cloud Connection, click +.
- In the New Connection window, fill in the following fields:
- Access Key ID — enter the access key ID that you copied and saved previously.
- Secret Access Key — enter the secret key that you copied and saved previously.
- Region — enter the AWS region that you copied and saved previously.
- Bucket Name — enter the name of the bucket that you copied and saved previously.
- Click Create, then Save.
- Make sure that you have access to Google Cloud Storage and that at least one bucket has been created, or create a new one. Note that the bucket must be publicly available; otherwise, users cannot upload files via the chat interface.
- Open the Google Cloud console.
- In the left-side menu, select Cloud Storage > Buckets.
- On the Buckets page, copy the name of the target bucket from the Bucket column. This bucket will store user-uploaded files. Save the bucket name for later use.
- In the left-side menu, select IAM & Admin > Service Accounts.
- From the Email field, copy the email address and save it for later use.
- In the Actions column, click Actions > Manage Keys.
- On the Keys tab, click Add Key > Create New Key and select the JSON key type. The key will be downloaded to your computer. Open the JSON file and copy the entire value of the
private_key
parameter, including the lines:Save the key for later use.-----BEGIN PRIVATE KEY----- -----END PRIVATE KEY-----
- On the Cognigy.AI side, open the Project that contains the Endpoint for which you want to configure file uploads. In the left-side menu of the Project, select Deploy > Endpoints. On the Endpoints page, select one of the Endpoints that supports file uploads or create a new one.
- On the Endpoints Settings page, go to the File Storage section.
- From the File Storage Provider list, select Google Cloud.
- Next to Google Cloud Connection, click +.
- In the New Connection window, fill in the following fields:
- Bucket Name — enter the bucket name that you copied and saved previously.
- Client Email — enter the email address that you copied and saved previously.
- Private Key — enter the key that you copied and saved previously.
- Click Create, then Save.
After setting up, open the chat in test mode and upload a file to the chat interface by either dragging it from your computer or using the Attach file button. The file will begin uploading automatically.
To test file uploads for the Webchat v2 and Webchat v3 Endpoints, use Demo Webchat. For other Endpoints, testing only works in the production environment. Upload a file to the chat interface and go to the file storage on your provider's side. If the file appears in the storage, then file uploads work correctly.