IE浏览器:FileUpload控件不能识别长文件名的文件 [英] Internet Explorer: FileUpload control doesn't recognize files with long file names

查看:410
本文介绍了IE浏览器:FileUpload控件不能识别长文件名的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可能会想读这个问题,这是不现实的莫名其妙,但下面的情况是存在于我们的生产应用之一了。

You might think after reading this question that it is somehow unrealistic but the below situation is there in one of our production applications.

我们的一个用户的报告,如果他试图用太长的名称上传文件,他是得到一个错误,我们得到了修复,通过限制文件名不能超过255个字符,包括文件扩展名。但是,我们面临的另一个怪异的行为是有只在Internet Explorer中。

One of our users reported that he is getting an error if he tries to upload files with too long names, we got to fix that by limiting file names to not exceed 255 chars including file extensions. But we faced another weird behavior that is there in Internet Explorer only.

如果用户试图上传的文件其长度包括扩展为255个字符,文件上传不采摘文件(即不承认文件),并显示文件名的文本框中仍为空白。这是IE8,IE9和IE 10有效!这是ASP.NET或SharePoint解决方案有效。

If user tries to upload a file that its length including extension is 255 chars, FileUpload is not picking the file (i.e. doesn't recognize file) and the textbox that shows the filename remains blank. This is valid in IE8, IE9 and IE 10 ! This is valid in ASP.NET or SharePoint solutions.

我试着上传Gmail中的同一个文件,我可以把它上传在除了IE的所有浏览器,这意味着它是一些涉及到IE浏览器。

I tried to upload the same file in GMail, I was able to upload it in all browsers except Internet Explorer which means it is something related to IE.

有什么建议?任何修正?

Any suggestions? any fixes?

推荐答案

不幸的是,它似乎是(已经?)一个窗口的功能。

Unfortunately, it seems to be (have been?) a windows "feature".

请参阅:
http://msdn.microsoft.com /en-us/library/aa365247%28v=vs.85%29.aspx#maxpath

一个本地路径是按以下顺序结构:盘符,
  用反斜杠分开冒号,反斜杠,名称组件和
  终止空字符。例如,在驱动器D的最大路径
  为D:\\一些256个字符的路径字符串,其中再presents
  无形终止空字符为当前系统
  codePAGE。

A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character. For example, the maximum path on drive D is "D:\some 256-character path string" where "" represents the invisible terminating null character for the current system codepage.

我想你应该避免操作文件有十足的路径超过260个字符,

I guess you should avoid manipulating files which full path exceeds 260 chars,

不知道它是否会工作使用\\?\\很长的名字preFIX在文件输入文本框。

Don't know if it would work using the "\?\" very long name prefix in the file input text box.

希望这会有所帮助。

这篇关于IE浏览器:FileUpload控件不能识别长文件名的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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