0

JavaScript-TypeScript for Nintex Forms to Validate File Names

Spread the love

JavaScript-TypeScript for Nintex Forms to Validate File Names

 

This article is going to discuss how to implement JavaScript-TypeScript for Nintex Forms to Validate File Names before they’re uploaded to SharePoint.

 

When I was a complete newbie to SharePoint and developing Nintex forms that included file attachments, I had all sorts of fun learning about the extra special characters SharePoint doesn’t like in file names in addition to those already restricted by Microsoft Windows opreating system.

 

Yet I see a lot of Nintex form solutions which do not consider nor address those limitations.

 

Microsoft has published the whole list of not allowed characters here: http://support.microsoft.com/kb/905231

 

The Nintex Forms issue

The Nintex Forms “Attachments” control does not have an option to prevent file attachments with invalid file names with out of the box functionality.

 

Obviously, the only right way before storing the file in the SharePoint library using custom Nintex solutions is to validate attachment names before uploading.

 

JavaScript-TypeScript to the rescue!

To prevent users of SharePoint Nintex forms from attaching files with invalid characters, here is JavaScript-TypeScript for Nintex Forms to Validate File Names before uploading to SharePoint that you can use: