Skip Navigation
Expand
File Extension Type restrictions when creating incident from Ask a Question page
Answer ID 4686   |   Last Review Date 03/21/2023

How do you restrict file extension types when customers create an incident on the Ask a Question page?

Environment: 

Customer Portal, File Attachments

Resolution:

In Customer Portal (CP) versions 3.8 and lower there is a 'valid_file_extensions' attribute in the FileAttachmentUpload/FileAttachmentUpload2 widgets 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/input/FileAttachmentUpload

Example:
<rn:widget path="input/FileAttachmentUpload" valid_file_extensions="gif,pdf,doc"

Customer Portal v2.x:

standard/input/FileAttachmentUpload2

 

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 to 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/ask.php