U4-1955 - Error: The fully qualified file name must be less than 260 characters...

Created by Mike Chambers 19 Mar 2013, 12:46:38 Updated by Shannon Deminick 26 Jun 2017, 06:50:57

When we end up with a very long url

eg.. http://www.domain.com.preview.co.uk/our-financials/consolidated-financial-statements-for-the-year-ended-31-december-2012/notes-to-the-consolidated-financial-statements/1-basis-of-presentation-and-principal-accounting-policies

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.

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.IO.PathTooLongException: 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.

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:

[PathTooLongException: 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.] System.IO.PathHelper.GetFullPathName() +999 System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength) +2442 System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath) +144 System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) +165 System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) +112 System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) +38 System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path) +92 System.Web.HttpRequest.get_PhysicalPath() +77 UrlRewritingNet.Web.UrlRewriteModule.OnBeginRequest(Object sender, EventArgs e) +84 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270

Think this could be down to the core using filepath operations to manipulate the url???

Comments

Shannon Deminick 08 Sep 2013, 23:16:55

Looks like this exception stems from UrlRewritingNet, will have to see whats going on inside of that library.


Alan Valentine 24 Feb 2014, 14:20:44

Hi Guys, this is posing a problem for us as it interferes with our ability to track referrals, which requires long paths for us.

Could you provide any update on this issue?

Thanks

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. at System.IO.PathHelper.GetFullPathName() at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength) at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath) at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path) at System.Web.HttpRequest.get_PhysicalPath() at UrlRewritingNet.Web.UrlRewriteModule.OnBeginRequest(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)   at System.IO.PathHelper.GetFullPathName() at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength) at System.Security.Util.StringExpressionSet.CanonicalizePath(String path, Boolean needFullPath) at System.Security.Util.StringExpressionSet.CreateListFromExpressions(String[] str, Boolean needFullPath) at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, AccessControlActions control, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) at System.Security.Permissions.FileIOPermission.AddPathList(FileIOPermissionAccess access, String[] pathListOrig, Boolean checkForDuplicates, Boolean needFullPath, Boolean copyPathList) at System.Security.Permissions.FileIOPermission..ctor(FileIOPermissionAccess access, String path) at System.Web.HttpRequest.get_PhysicalPath() at UrlRewritingNet.Web.UrlRewriteModule.OnBeginRequest(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)


Yakov Lebski 24 Feb 2014, 14:39:33

Can you try it


Stephan 06 Oct 2014, 07:18:47

FWIW I think this is an IIS / Windows limitation that each url segments must be shorter that 260 char - nothing much can be done about it apart from keeping each segment short enough. The httpRuntime.maxUrlLength setting allows for long urls - but each segment within that url must be shorter that 260 chars.

Had the same issue with ClientDependency where we had to split the long Base64 into shorter-that-260-chars segments to get it to work.

Just keep your url names short ;-)


Antony Briggs 16 Dec 2014, 09:39:01

Hi All,

A client has just bumped against this in u7.1.9 - I understand the restriction comes from Windows/IIS but it would be nice if Umbraco warned the editor when creating a page that had a name longer than 248 characters (esp if the name were to be url-encoded like in U4-4029).

Thanks.


Asbjørn Riis-Knudsen 16 Dec 2014, 11:11:22

Could this be due to the fact that UrlRewriting.NET is attempting to check whether the path matches a physical file on disk? Windows doesn't like paths longer than 260 characters and thus complains.


Shannon Deminick 26 Jun 2017, 06:50:58

Closing issue due to inactivity - see blog post for details https://umbraco.com/blog/issue-tracker-cleanup/


Priority: Normal

Type: Bug

State: Closed

Assignee:

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 4.11.6

Due in version:

Sprint:

Story Points:

Cycle: