Skip Navigation
Expand
File Extension Type restrictions for uploading files on the chat landing page
Answer ID 12603   |   Last Review Date 05/09/2023

How do you restrict file extension types when customers upload a file in chat?

Environment: 

Customer Portal, File Attachments, chat

Resolution:

In Customer Portal (CP) versions 3.8 and lower there is a 'valid_file_extensions' attribute in the ChatAttachFileButton widget where you can define a list of accepted file extensions without leading periods and separated by commas. CP 3.9 and greater uses the CP.ValidFileExtensions and CP.ValidFileMimeTypes values set in siteConfig.json instead.

Please note, the 'valid_file_extensions' default for the attribute is defined by all extensions.

You can edit this widget by going to the path below:

Customer Portal v3.x (3.8 and lower):

standard/chat/ChatAttachFileButton

Example:
<rn:widget path="chat/ChatAttachFileButton" valid_file_extensions="gif,pdf,doc" />

 
For customers on CX version 23A+ will also have access to a config verb called VALID_FILE_EXTENSIONS. You will need to make sure that any changes you make to the siteConfig.json (CPv3.9), or 'valid_file_extensions widget (CPv3.8) matches the config verb. If not, then the restrictions will not work.
 
To edit widgets, you will need to access to Customer Portal first. For more information about Customer Portal, please see Overview of Customer Portal section in documentation.
 
To access your Customer Portal, you’ll also need a WebDAV client for downloading and uploading files. Please see Answer 2600: Configuring WebDAV connection to access the Customer Portal or Answer 4704: Popular Answers About WebDAV for more information about using WebDAV. 
 
The widget can be found in file: cp/customer/development/views/pages/chat/chat_landing