Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Jeremy Wiggins 7 posts 40 karma points
    Nov 19, 2012 @ 16:08
    Jeremy Wiggins
    0

    Getting error if request to /Base webmethod exceeds 260 characters

    I'm working with the Dashboard PreValue Editor package, which can be found at http://our.umbraco.org/projects/backoffice-extensions/dashboard-prevalue-editor.

    When editing a datatype, the package makes a post to a webspace, adhering to the /Base standards outlined here - http://our.umbraco.org/wiki/reference/umbraco-base/simple-base-samples

    This works fine when I don't pass many prevalues to the webmethod.  But if I pass a lot of values, then the call errors out, producing an error of 

    The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.


    I've tried editing the httpRuntime element in the web.config as follows:

    <httpRuntime requestValidationMode="2.0" maxRequestLength="32767" maxUrlLength="1024" maxQueryStringLength="2000" requestPathInvalidCharacters="&lt;,&gt;,*,%,:,\,?"/

    But that hasn't worked either.  I'm at a loss here.  Do I need to configure something with URL rewriting within umbraco?  Is there an IIS setting I should check?  Any help would be greatly appreciated.

  • Grant Thomas 291 posts 324 karma points
    Nov 19, 2012 @ 17:15
    Grant Thomas
    0

    Well, this isn't something you're going to be able to overcome by configuring a few settings (to my knowledge), and will require some thought going in to reworking the package to not let this happen. It's nothing strictly to do with IIS, .NET, or the nature of the internet, and the beast you're working with. The error is a familiar one, it's a standard Windows API error message that the developer of the package has no control over, but just maybe never expected to be generating file system objects with names that are not supported by the operating system.

    What looks to be going on here (and this is pure conjecture, mind you, based on intuition spurred by the explanation in the error message) is that a file system object is being written to a server drive as part of the request, the name of which is presumably based upon the values as input (along with any other thing, like an actual name, say), and the ultimate resulting name (full path, including dir) exceeds the legal allowed limit by the Windows operating system (which is 260, as mentioned, and also includes the drive letter, colon and separator in that count, eating into precious path chars) and this error propogates up from the kernal / hardware driver level.

    Bear in mind that I am not familiar with the Dashboard Prevalue Editor package, so this could well have been addressed and a workaround implemented/supported.

    See here for some info from Microsoft.

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 20, 2012 @ 06:52
    Tom Fulton
    0

    I've seen this before also and didn't find a solution.  Instead of passing a long URL to the base method (ie /base/Extension/Method/param1/param2/param3, etc), I rewrote my code to POST (or GET) some of the data instead of including it in the URL.  Might need to do the same with this package if it's causing issues.

    -Tom

  • Stephen 767 posts 2273 karma points c-trib
    Nov 20, 2012 @ 09:06
    Stephen
    1

    IIS by default ensures that url segments (anything between slashes) is shorter than 260 chars. All the things that you can configure in . You might want to set relaxedUrlToFileSystemMapping to accept chars that would not map to valid NTFS filenames, but that won't change the 260 chars limit. IIS6 has a registry setting (UrlSegmentMaxLength) that would let you change this, I have no idea whether that would also apply to IIS7+

    In ClientDependency we faced the same issue at some point, and decided to path-split the urls. In your case, if you have /base/ext/method/very-long-more-than-260-chars -- you have to find a way to split the very long part into less-than-260 segments... eg /very/long/more/that/260/chars

    Sources:

    Edit: http.sys is still used in II7 so maybe that registry setting also applies. You'll have to _reboot_ though, simply iisreset does not seem to be enough.

  • Lev Nuznyy 19 posts 122 karma points
    Feb 26, 2016 @ 04:56
    Lev Nuznyy
    3
    <httpRuntime requestValidationMode="2.0" enableVersionHeader="false" targetFramework="4.5" maxRequestLength="51200" relaxedUrlToFileSystemMapping="true" maxUrlLength="1024" maxQueryStringLength="2000"  fcnMode="Single"/>
    
Please Sign in or register to post replies

Write your reply to:

Draft