完整路径必须小于260个字符? [英] full path must be less than 260 characters?

查看:681
本文介绍了完整路径必须小于260个字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将web应用程序中的一个菜单项指向下面的路径:

  http:// localhost / Reports / Pages / Folder.aspx?ItemPath = / Parent Reports / Child Reports 

当我点击它时,报表管理器UI显示以下消息:

lockquote

项目的路径http://localhost/Reports/Pages/Folder.aspx?ItemPath = /父母报告/子女报告无效。完整的路径长度不得超过260个字符;其他限制适用。如果报表服务器处于纯模式,那么路径必须以斜杠开始。


建议。谢谢。

解决方案

请注意,Windows确实实施了传统MS-DOS 260字符路径限制的解决方案。这是Long UNC路径格式,以 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \file.txt



如果您有权访问产生此错误的Web服务的源代码,您可以尝试在将URL参数转换成本地文件路径的服务代码,看看在前面加上\ \\ \\ \\是否有帮助。

这似乎也很奇怪你会得到这个文件路径错误消息的URL。检查你的代码(或者web服务的代码),看看是否有人正在使用路径功能,他们应该使用URI函数。

最后,注意你的例子包含空格字符,无论是在路径和URI。空格字符在URI中是绝对禁止的;您需要使用%20将它们转义,以使其成为有效的URI。这可能是问题的真正原因--Web服务实际上并没有收到您发送的整个URI,因为URI解析将在第一个空格字符处停止。

I point one of the menu items in my web application to the below path

http://localhost/Reports/Pages/Folder.aspx?ItemPath=/Parent Reports/Child Reports

When I click on it the report manager UI displays the following message:

The path of the item 'http://localhost/Reports/Pages/Folder.aspx?ItemPath=/Parent Reports/Child Reports' is not valid. The full path must be less than 260 characters long; other restrictions apply. If the report server is in native mode, the path must start with slash.

Pls. suggest. Thanks.

解决方案

Note that Windows does implement a solution to the legacy MS-DOS 260 char path limit. It's the Long UNC path format, which starts with \\?\ such as \\?\c:\path\file.txt.

If you have access to the source code of the web service producing this error, you might try digging around in the service code that converts the URL arguments into local file paths and see if tacking the \?\ on the front helps matters at all.

It also seems odd that you would get this file path error message on a URL. Check your code (or the code of the web service) to see if somebody is using Path functions where they should be using URI functions.

Finally, note that your example contains space characters, both in the path and in the URI. Space characters are definitely prohibited in URIs; you will need to URI escape them with %20 to make them valid URIs. That could be the real cause of the problem - the web service is not actually receiving the whole URI you're sending, since URI parsing will stop at the first space character.

这篇关于完整路径必须小于260个字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆