Internet Explorer: FileUpload control does not recognize files with long file names

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

One of our users reported that he gets an error if he tries to upload files with too long names, we have to fix this by limiting the filenames to 255 characters or less, including file extensions. But we ran into another strange behavior that is only found in Internet Explorer.

If the user tries to upload a file that includes a 255-character extension, FileUpload does not select the file (that is, it does not recognize the file), and the text box displaying the file name remains blank. This is valid in IE8, IE9 and IE 10! This is true in ASP.NET or SharePoint solutions.

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

Any suggestions? any fixes?

+1


source to share


1 answer


Unfortunately, it seems like it was (was?) A "feature" of Windows.

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

The local path is structured in the following order: drive letter, colon, backslash, backslash-separated name components, and a null terminator. For example, the maximum path on the D drive is "D: \ some string with 256 characters", where "" represents an invisible trailing null character for the current coding system.



I think you should avoid manipulating files, the full path is over 260 characters,

Don't know if it will work with a very long name prefix "\? \" In the file input text box.

Hope this helps.

0


source







All Articles