This time: Why the Internet Explorer supports only 251 (with extension) character filenames?
Recently our test guy of the QA department of our company was testing our newest web application. We have a simple HTML form file upload included in this app. The test case said that we check for file names with a maximum of 255 characters. The app is used with IE6 (yes it’s still out there), so we still have to test it there.
We got a ticket with: “Cannot upload file with more than 222 chars” from our QA. We checked the problem and found out that this seems to be a problem only in IE (6 and 7) not in Firefox. Funny. We also found out that NTFS supports only path length of 255 (not filename length). That means file can only have 255 chars in the root of the filesystem.
With this in mind we tested again – this time with files in the root of the file system – there they could be 255 chars. Again the problem was in IE – Firefox could upload files with 255 char filenames. We checked the Web for this without really finding anything.
Then I found out that the only problem in IE is the file picker – in the filename field you can enter 255 chars. You cannot select a file with more than 251 chars in the file system root.
Then our QA guy found the root of the problem: Microsoft Office does not support filename over a certain length (depends on version). You cannot open or save files with MsOffice 2000 with a filename longer than 251 chars (see also Microsoft Office Applications File Name Length Limitation). There is the reason.
Now you can ask yourself: “Does IE use the Office file picker or did the IE guys restrict filenames because of office? We’ll never know.