Issue with browsing files in browser having special characters in file name and fix
After upgrading one of our very old customer’s website from EPiServer 4.62 to CMS 6 R2, it was reported that documents with special characters in file name (for e.g. ‘S&R12.pdf’) throwing ‘System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (&).’ when they are being opened up in browser.
Fix for this is issue is to just add requestPathInvalidCharacters="" if you want to allow all special characters.
The above attribute must be added to the element <httpRuntime> in your website’s web.config so that it will look as follows:
<configuration>
.
.
<system.web>
.
.
<httpRuntime requestValidationMode="2.0" requestPathInvalidCharacters="" />
.
.
</system.web>
.
.
</configuration>
If you want to restrict certain special characters then make sure you specify them as requestPathInvalidCharacters="<,>,*,%,:,&,\"
Comments