File not found error when loading the display form on an item that has attachments with special characters
A file not found error shows when loading the display form on an item that has attachments with special characters.
The error shows when editing or viewing the display form where the attachment control resolves to show all attachments for the item.
This is a known issue and possibly a Microsoft oversight in CSOM. As a precaution please don't use special characters in file names.
Important to note is that SharePoint OOTB List Attachments doesn’t allow attachments with special characters.
K2 uses CSOM to upload the attachments and that should have been blocked by MS since OOTB SharePoint forms doesn’t allow it.
Please use the following workaround:
1. Switch to use the OOTB SharePoint forms and delete the attachment with the special character in it. You may also have the option to edit the file in MS Word or Excel online where you can change the name to remove the special character and save it back to the list.
2. Use the Attachment SmartObject > Remove All Attachments Method to delete the Attachment. (The Remove Attachment Method doesn’t work against special characters).
3. Build validation in your form to validate the file name for special characters and based on that block upload.
Sample Validation (How To)
- Validating if attachment contains a Apostrophe.
- Edit the “Attachment List add Attachments” View.
- Edit the “When Add Attachment Button is Clicked” rule.
- Set advanced condition that validates if the control contains an apostrophe.
If this condition is true then show a message to the user (Apostrophes in file names not supported).
Stop all rule execution if this condition was true.