Attachments with restricted characters can be added to list items in SharePoint 2019 but cannot be saved

Holly Anderson 1 Reputation point
2021-04-07T18:23:26.343+00:00

Hello,

I'm running into some odd behavior with list item attachments in SharePoint 2019. If I add an attachment with % or # in the name (e.g. t#%t.txt) to a list item, the file is either removed on save (classic mode) or inaccessible after save (modern mode). In classic mode, the list item is saved without the attachment and an error is reported about the attachment containing illegal characters. In modern mode, the attachment appears to be added to the item when it is saved, but when I click the link and a new browser tab opens, I see "404 NOT FOUND" instead of the file contents.

Any idea why this is happening? In SharePoint 2013 and 2016, I would get an error message when trying to add attachments with restricted characters to a list item, so I never got to the point where they could be saved on an item.

Thanks,
Holly

SharePoint Server Development
SharePoint Server Development
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Development: The process of researching, productizing, and refining new or existing technologies.
1,619 questions
SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,957 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Elsie Lu_MSFT 9,796 Reputation points
    2021-04-09T07:33:49.577+00:00

    Hi @Holly Anderson ,

    Per my test, I would suggest you try to stop using similar special characters. Tests in each version show that SP does not support similar special characters.

    However, in my SP2019 environment, I found that if I add attachments with similar character names in the modern experience, and then I can see the content when I open it in the classic experience, you could have a look:
    86163-test.gif

    My test results:
    SP 2013 Build Number 15.0.4617.1000:
    86117-2013.jpg

    ============

    SP 2016 Build Number 16.0.4327.1000:
    86109-2016.jpg

    ================

    SP 2019 Build Numer 16.0.10711.37301:
    Modern:
    86118-2019.jpg
    Classic:
    86128-spo-classic.gif

    ===============

    SPO:
    86085-spo.jpg


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Holly Anderson 1 Reputation point
    2021-04-09T12:18:19.847+00:00

    @Elsie Lu_MSFT ,

    I understand special characters may not be supported, but the way in which they are handled in SharePoint 2019 is inconsistent with previous versions. First, attachments which are named with special characters can be added to items in classic mode, which is not true in SharePoint 2013 or 2016. An error is then reported when the item is saved, but the item is saved successfully without the attachment. Second, if such an attachment is added in modern mode, the item can be saved with the attachment, which then cannot be viewed. Though, as you mentioned, it can be viewed by switching back to classic mode. This seems to suggest that attachments with names containing special characters can in fact be saved properly in SharePoint, so I'm not even sure why this restriction exists.

    This behavior seems like a bug, particularly the part about not being able to view such attachments in modern mode. Is it possible to report this as an issue to the appropriate team?

    Thanks,
    Holly


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.