Web.config 檔案中 requestFiltering 元素的設定不正確 (SharePoint Server)Web.config file has incorrect settings for the requestFiltering element (SharePoint Server)

摘要: 了解如何解決 SharePoint Server 2016 和 SharePoint 2013 的 SharePoint Health Analyzer 規則「Web.config 檔案中 requestFiltering 元素的設定不正確」。Summary: Learn how to resolve the SharePoint Health Analyzer rule "Web.config file has incorrect settings for the requestFiltering element", for SharePoint Server 2016 and SharePoint 2013.

規則名稱: Web.config 檔案中 requestFiltering 元素的設定不正確。Rule Name: Web.config file has incorrect settings for the requestFiltering element.

摘要: 若要支援包含 + 字元的檔案名稱,Web.config 檔案中的 requestFiltering 元素必須將 allowDoubleEscaping 屬性設為 True,且 requestLimits 元素的 maxAllowedContentLength 值必須設為 2147483647 以避免干擾檔案上傳。Summary: To support file names that contain the + character, the requestFiltering element in the Web.config file must have the allowDoubleEscaping attribute set to True and it must have a requestLimits element that has a maxAllowedContentLength value set to 2147483647 to avoid interfering with file upload.

原因: Web.config 檔案中 requestFiltering 元素的設定不正確。Cause: The settings of the requestFiltering element in the Web.config file are incorrect.

解決方案:變更 Internet Information Services (IIS) 中 Web.config 檔案的 requestFiltering 設定。Resolution: Change the requestFiltering settings in the Web.config file in Internet Information Services (IIS).

  1. 確認執行此程序的使用者帳戶是伺服器陣列管理員群組的成員。Verify that the user account that is performing this procedure is a member of the Farm Administrators group.

  2. 識別發生此事件的伺服器。在 SharePoint 管理中心網站上,按一下 [監視]**** 區段中的 [檢閱問題與方案]*,然後在 [失敗的伺服器]* 欄中尋找伺服器的名稱。如果伺服器陣列中有多部失敗的伺服器,則必須在每部失敗的伺服器上重複下列步驟。Identify the server on which this event occurs. On the Central Administration Web site, in the Monitoring section, click Review problems and solutions, and then find the name of the server in the Failing Servers column. If there are multiple failing servers in a server farm, you must repeat the following steps on each failing server.

  3. 確認執行下列步驟的使用者帳戶是您在先前步驟中識別之本機電腦上系統管理員群組的成員。Verify that the user account that is performing the following steps is a member of the Administrators group on the local computer that you identified in the previous step.

  4. 登入發生此事件的伺服器。Log on to the server on which this event occurs.

  5. 在 [伺服器管理員]**** 中,按一下 [工具]*,然後選取 [Internet Information Services (IIS) 管理員]On **Server Manager, click **Tools, and then select **Internet Information Services (IIS) Manager*.

  6. 在 Internet Information Services 管理主控台的 [連線]**** 窗格中,展開伺服器名稱的樹狀檢視、展開 [網站]*,然後按一下您要變更其 requestFiltering 設定的網站。In the Internet Information Services management console, in the *Connections pane, expand the tree view of the server name, expand Sites, and then click the site for which you want to change the requestFiltering settings.

  7. 在網站首頁上,切換至 [功能檢視]*,然後在 [管理]* 區段中,按兩下 [設定編輯器]*On the site Home page, switch to *Features View, and then in the Management section, double-click Configuration Editor.

  8. 在 [區段]**** 清單中,展開 [system.webServer]*、展開 [安全性],然後按一下 [requestFiltering]In the *Section list, expand system.webServer, expand security, and then click requestFiltering.

  9. 在 [設定編輯器] 頁面上,確定下列屬性或元素已存在且已正確設定:On the Configuration Editor page, ensure the following attributes or elements exist and are configured correctly:

    • allowDoubleEscaping 屬性設為 TrueThe allowDoubleEscaping attribute is set to True.

    • requestLimits 元素已存在。The requestLimits element exists.

    • requestLimits 元素具有 maxAllowedContentLength 屬性且其值設為 2147483647The requestLimits element has a maxAllowedContentLength attribute and its value is set to 2147483647.

      如需詳細資訊,請參閱以程式設計方式新增和移除 Web.config 設定For more information, see <maml:externalLink><maml:linkText>How to: Add and Remove Web.config Settings Programmatically</maml:linkText>

  10. 完成這些設定的變更之後,請在 [動作]**** 窗格中,按一下 [套用]*After you have made changes to these settings, in the *Actions pane, click Apply.