Why does my form not upload files in Internet Explorer 9?

微笑、不失礼 提交于 2019-12-04 22:37:45

I was able to fix this nightmare of a problem by wrapping a jQuery form submit in a setTimeout:

$('#complete_profile input[type="submit"]').click(function(){
  setTimeout(function() {
    $('#complete_profile form').submit();
  }, 0);
});

This may cause duplicate submission when the form DOES submit, however, so be careful.

As Graham does, I think that this might more be a server issue - also I have never had issues with fileuploads in IE9 (or newer) - I guess you don't want to post the code of the PHP Script that handles the upload?

if any data is not being sent, You could check the post data by your hidden input on your server side script. For example if you're using php it would be something like

<? if($_POST['resume_form']=='resume_form'){
    //Do something
} ?>

Or you could also use meta compatible tags for IE to render the page like IE8

<meta http-equiv="X-UA-Compatible" content="IE=8" />
Roy Tinker

I suggest setting the X-UA-Compatible meta tag value and seeing whether that makes any difference.

See this question for possible values: What does <meta http-equiv="X-UA-Compatible" content="IE=edge"> do?

It may also be that the page is triggering a non-standards mode in IE9. I suggest opening the page in IE9, opening the developer tools, and seeing which browser/document modes are selected. That may give you a clue. Note that the "enctype" form attribute was not supported prior to IE8, so if the browser is using an older doc mode, that attribute is not being recognized.

OK I'd rather leave a comment not an answer but I don't have the points for that yet!

  1. Are the users in quirks mode? Most IE users are unaware of the quirks mode and may have accidentally clicked it when trying to refresh the page (instead of pressing F5). If it is intermittent this could be the reason why.

  2. following on from above.. On the server side how are you checking for empty fields? I'm more on the lines of JS here where you often look for "", null and undefined I'm just thinking that perhaps the quirks mode is sending some fuzzy data that your server side error checking is missing because you aren't looking for it and hence reports all is OK.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!