How to include & and space characters in AllowedFilePaths section of service configuration in Spotfire

How to include & and space characters in AllowedFilePaths section of service configuration in Spotfire

book

Article ID: KB0070114

calendar_today

Updated On:

Products Versions
Spotfire Web Player 7.5 and higher

Description

When adding UNC based paths which contain & and space characters, like "\\myserver\Reporting & Analytics", in the AllowedFilePaths section of the Spotfire.Dxp.Worker.Host.exe.config or Spotfire.Dxp.Worker.Automation.config files, like:
<!--A list of paths determining which parts of the file system may be accessed by file data sources-->
      <setting name="AllowedFilePaths" serializeAs="Xml">
        <value>
          <ArrayOfString>
              <string>"\\myserver\Reporting & Analytics\Spotfire Exports"</string>
          </ArrayOfString>
        </value>
      </setting>
    </Spotfire.Dxp.Data.Properties.Settings>
The Web Player or Automation Services instance will fail to start after the service configuration has been imported to the service, with the following error:
Details: Status notified as FAILED. The service exited with error code -532462766. Recent Logs: Error: Error: Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Spotfire.Dxp.Web, Version=28.0.11008.6057, Culture=neutral, PublicKeyToken=789861576bd64dc5' or one of its dependencies. The system cannot find the file specified. Attempt to communicate with service was unsuccessful.

Issue/Introduction

When adding UNC based paths which contain & and space characters, like "\\myserver\Reporting & Analytics", in the AllowedFilePaths section of the Spotfire.Dxp.Worker.Host.exe.config or Spotfire.Dxp.Worker.Automation.config files, the service will fail to start.

Resolution

All paths are parsed in XML by Spotfire. So the provided path should be XML compatible and needs to be encoded in XML readable format. For example:
  • & = &amp;
  • Space = &#x20;
Replace the "&" and space with the above mentioned encoded references, resulting an example like:
<!--A list of paths determining which parts of the file system may be accessed by file data sources-->
      <setting name="AllowedFilePaths" serializeAs="Xml">
        <value>
          <ArrayOfString>
              <string>\\myserver\Reporting&#x20;&amp;&#x20;Analytics\Spotfire&#x20;Exports</string>
          </ArrayOfString>
        </value>
      </setting>
    </Spotfire.Dxp.Data.Properties.Settings>
Which when imported, will allow the Web Player or Automation Services instances to start.
 

Additional Information

Doc: Spotfire.Dxp.Worker.Host.exe.config > allowedfilepaths Doc: Spotfire.Dxp.Worker.Automation.config > allowedfilepaths External: List of XML and HTML character entity references