none
A potentially dangerous Request.Path value was detected from the client (?).

    Question

  • I am using Webhandler to upload images to the server. I want to send the folder name so on that folder the images will save. I am using this URI format and got the below error.

    builder.Path = builder.Path.TrimEnd('/') + "/Services/FileReceiver.ashx?foldername=" + folder;

    this.Uri = builder.Uri; 

    Also I added the following line in the web.config but still having the issue.

    <httpRuntime requestValidationMode="2.0" />

     

    A potentially dangerous Request.Path value was detected from the client (?).

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Web.HttpException: A potentially dangerous Request.Path value was detected from the client (?).

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [HttpException (0x80004005): A potentially dangerous Request.Path value was detected from the client (?).]
       System.Web.HttpRequest.ValidateInputIfRequiredByConfig() +8884233
       System.Web.ValidateRequestExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +35
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

    Friday, May 14, 2010 10:54 AM

All replies

  • Is there a policy file on the server root ? if none, add one and try again to see if the problem is still there.

    Saturday, May 15, 2010 1:12 PM
  • Hi, 

    Thanks for your reply.

    Policy file is there in the server root. Still having the same problem. Any other solution?

    Sunday, May 16, 2010 2:11 AM
  • Please try to add a slash behind the "ashx" , so the url will look like "/Services/FileReceiver.ashx/?foldername="

    Sunday, May 16, 2010 11:33 PM
  • Hi, Thanks for your reply. I tried your solution but not working.
    Monday, May 17, 2010 6:18 AM
  •  Can you give an example of the full Uri (with query string)? I've seen similar exceptions when sending HTML tags over GET/POST to a .NET server, but I don't understand why that would happen here.

    Monday, May 17, 2010 11:18 AM
  • Hi, Thanks for your reply. This is the full Uri: http://localhost:52878/services/FileReceiver.ashx?foldername=profileimages
    Thursday, May 20, 2010 2:11 AM