Santosh Achanta
Nov 22, 2012
  6540
(1 votes)

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="&lt;,&gt;,*,%,:,&amp;,\"

Nov 22, 2012

Comments

Nov 22, 2012 08:15 AM

See my blogpost for how to activate validation on filenames in the EPiServer filemanager. I think you don't have this setting since you have upgraded from an EPi 4 site.

http://world.episerver.com/Blogs/Per-Nergard/Dates/2011/6/Hot-to-add-validation-of-folder-names-in-CMS5-filemanager/

Santosh Achanta
Santosh Achanta Jan 17, 2013 10:15 PM

Hi Per, the settings illegalCharactersRegex and illegalCharactersDisplayString doesn't help me with this problem unless I have the setting I have specified in this blog. Also in EPiServer 7 the settings you mentioned are no more valid.

Please login to comment.
Latest blogs
Optimizely Forms: You cannot submit this form because an administrator has turned off data storage.

Do not let this error message scare you, the solution is quite simple!

Tomas Hensrud Gulla | Oct 4, 2024 | Syndicated blog

Add your own tools to the Optimizely CMS 12 admin menu

The menus in Optimizely CMS can be extended using a MenuProvider, and using the path parameter you decide what menu you want to add additional menu...

Tomas Hensrud Gulla | Oct 3, 2024 | Syndicated blog

Integrating Optimizely DAM with Your Website

This article is the second in a series about integrating Optimizely DAM with websites. It discusses how to install the necessary package and code t...

Andrew Markham | Sep 28, 2024 | Syndicated blog

Opticon 2024 - highlights

I went to Opticon in Stockholm and here are my brief highlights based on the demos, presentations and roadmaps  Optimizely CMS SaaS will start to...

Daniel Ovaska | Sep 27, 2024