I have a form with a few fields. When you submit the form, the server responds with a redirect (HTTP 302).
When the form is submitted, if there is an <input type=file> field, IE doesn’t follow the redirect, but instead gives an error: “Internet Explorer cannot display the webpage”.
If there is no <input type=file> field, then it does follow the redirect as expected.
The HTTP 302 Response is exactly the same in both cases, differing only by the timestamp of the response.
I’m experiencing this in IE8 and IE9. (I haven’t tried lower versions). Firefox, Chrome, Opera and Safari all follow the redirect as expected.
Notes:
- The form has the attribute
enctype="multipart/form-data". - This is happening over SSL
- The redirect is not to a different protocol, host, or port than the URL the form POSTs to or is hosted on.
- When I inspect HTTP traffic with Fiddler2, the issue disappears and IE behaves.
Is your redirect to a partial URL or a complete URL (with host, protocol, etc.)? I have seen plenty of examples in PHP where a redirect with 302 that does not have a complete http://server.dom/path/to/file in it will be ignored or mangled by IE. In Rails, this can be the difference between foo_path and foo_url in the router.