0

Recently, we started having this error on our Sharepoint 2013 server, and I can't seem to find the solution anywhere.

When someone goes to attach a file to a list item, we get the error "File names can't contain..." then a list of invalid characters. Problem is, our file names DON'T contain invalid characters, as shown in the screenshot. Any help resolving this quickly would be GREATLY appreciated!

![screenshot]1

4
  • Does this happen with any file? I noticed in your screenshot there is a space in the name. If you remove the space does it work? Sep 10, 2015 at 21:13
  • The space isn't the issue, the issue was discovered trying to upload a file named 'doug'. Sep 10, 2015 at 21:20
  • Are you using OOOTB "seattle.master" system masterpage? if not, try to change it to "seatle" and then try, It might because of custom JS written somewhere in your page. Sep 11, 2015 at 7:05
  • Yes, we are using it. Keep in mind, this was working fine up until about Tuesday of this week. And we have pretty much all OOTB features. No custom JavaScript. Sep 11, 2015 at 13:10

3 Answers 3

1

Since yesterday there is a new update from microsoft.
https://support.microsoft.com/en-us/kb/3085582
Maybe this will solve the issue.

0
0

Have you recently updated? The following Technet Article states that people have been experiencing this issue since installing the August CU.

However, there does seem to be a workaround

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.

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

4
  • That workaround doiesn't work for me; it still gives me the same error. And nope, this issue was just called in to us yesterday afternoon, Sep 10, 2015 at 20:44
  • In which case, I'd check the ULS logs to see if anything stands out.
    – Ben Izzard
    Sep 10, 2015 at 21:36
  • Also, I just checked with our system administrator head, and we haven't even updated to the August CU. Sep 11, 2015 at 13:27
  • Checked the logs...nothing seems out of place... Sep 11, 2015 at 18:00
0

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:

A temporary workaround is available for this issue, but 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:

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 second workaround is also available, this does not involve any file editing.

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.

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

1
  • For whatever reason, the workflow that does not require editing doesn't work. After saving and then trying to attach after, it gives the same error message. Sep 10, 2015 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.