views:

1131

answers:

3

One of our clients is breaking the software in every way imaginable, and he's just discovered this one.

If the user tries to upload a file with a very long filename (I think the user is trying with a 180 character filename), the FileUpload control refuses to recognise it on IE7.

Click on the Browse button, browse to the file, click on it, click the Upload button, and the text box that should show the filename is blank. Anyone know anything about this, fixes, etc?

I managed to find this asp.net forums discussion on it, but it didn't shed much light on the issue.

The app is written in Visual Studio 2008, and this occurs in IE7, but not FF3 or Chrome. If I use either of the other two browsers, it fills the FileUpload control correctly, but breaks when you actually try to do the upload because the resulting filename/path is too long.

Enjoy Random

+2  A: 

This might not be specifically an ASP.NET or even an IE7 problem.

Windows has a limit of 260 characters on full pathnames(*) and this can be easily reached with a few nested folders with long filenames, especially if you're starting in a user folder, which already has quite a long pathname (eg. 'C:\Documents and Settings\Brian Popalopadopaslopalos\My Documents' or 'Desktop').

When you hit that limit, things start to go screwy. Renaming files, moving folders, searching and so on all start to go wrong in curious ways. It would be no surprise if browsers also failed and there is probably not much you can do about it.

(* - things are actually a bit more complicated than that, but still...)

bobince
A: 

You would need to test this issue more and then put this in as a "Known Issue", giving the maximum size of filename you would accept.

Can they upload these files to hotmail? gmail? and file upload services?

Osama ALASSIRY
A: 

A bit of further testing seems to make it look like it's the 260 character limit on pathnames exposing a bug in IE7.

The test file I was using with a really long filename was sitting in my My Documents directory (so "C:\Documents and Settings\Random\My Documents"). Trying to Browse to this file was causing it to not fill in the FileUpload textbox.

I moved the file to the root of my C: drive, and Browsed to that file, and it worked fine (and then crashed when I tried to actually upload it, because the path name would have been greater than 260 characters on the server, which is what happened if I was using FF3 or Chrome).

So, it looks like it's a combination of a few things showing up a bug in IE7.

Thanks for the help.

Random