Thursday, September 24, 2015

SharePoint 2013 List Attachment Error, Issues with the August 2015 Cumulative Updates

August 2015 CU Error – “File names can’t contain the following characters”

Many thanks to Trevor Seward... http://ift.tt/1Mrrm9Z

As noticed on a TechNet forum post, the August 2015 CU for SharePoint 2013 has a new regression with attaching files to List Items. This can be reproduced with a Custom List (possibly others) by creating a new List Item, clicking “Attach File”, identify any file that contains characters not listed in KB905231, then click OK. The error message “File names can’t contain the following characters” will appear:

FileNameError

 

The work-around:

In a List, create a List Item and save it without attempting to attach a file. On the List, highlight the specific List Item that was created. In the ribbon, click on Items -> Attach File. This dialog will allow you to successfully attach a file to a List Item.

Or a more permanent resolution:

... involves editing files in the 15 hive. Prior to performing this, make backup copies of these files. These backups must be in place prior to installing the next SharePoint patch.

There are two JavaScript files that must be edited:

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\FORM.debug.js

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS\FORM.JS

For Form.debug.js, change the text starting on line 5307

From:

else {
       if (IndexOfIllegalCharInUrlLeafName(filename) != -1) {
       alert(Strings.STS.L_IllegalFileNameError);
       return;
}


To:

else {
       var filNameOnly = filename.substring(filename.lastIndexOf('\\') + 1);
       if (IndexOfIllegalCharInUrlLeafName(filNameOnly) != -1) {
       alert(Strings.STS.L_IllegalFileNameError);
       return;
}


And for FORM.js, find the following string:

From:

else{if(IndexOfIllegalCharInUrlLeafName(c)!=-1)


Change it to:

else{var j=c.substring(c.lastIndexOf("\\")+1);if(IndexOfIllegalCharInUrlLeafName(j)!=-1)

Once completed, clear the browsers cache and re-test. If the error still exists, try using Inprivate browsing mode, which will not use the cache from the regular session.

A PSS case has been opened for this issue and the above solutions are the current official workarounds.


by Mary via Everyone's Blog Posts - SharePoint Community

No comments:

Post a Comment