Uploading a File with Mac IE 5.1

It seems that the Macintosh version of Internet Explorer 5.1 adds spaces to the end of parameter values that are submitted with an enctype of multipart/form-data (in other words, when a file is being uploaded). I have seen people ask about this on various lists, so I thought I would address it here.

The fix seems to be to trim all your form variables. Normally I would not advocate coding around a single bug in a single obsolete browser, however I have found that trimming form variables is pretty good practice anyway, so this is just one more reason to do it.

The good news is that I cannot reproduce this problem in IE 5.2, so it looks like it’s been fixed. Even better news is that with Mozilla and Safari out there, there’s no need to even use IE anymore!

One Response to Uploading a File with Mac IE 5.1

  1. David says:

    This technique works fine for all formfields except the file upload field itself. TRIM()ing the file upload field will cause the file upload to fail. Try it.