Adding a onsubmit handler to a multipart form with a file input causes the file to not be POSTed to the server.
Created attachment 7956 [details] Upload form containing onsubmit
Created attachment 7957 [details] PHP script demonstrating the absence of the "file" property
I have tried removing the onsubmit handler, and the output from the script didn't change ("Array ( [title] => sometitle )"). Furthermore, it's the same in Firefox. Could you please clarify how to reproduce the problem?
Er, sorry. I need to provide a better reduction.
Created attachment 7960 [details] Better diagnostic script
The updated script works as expected for me (i.e., I cannot reproduce the bug): Request: Array ( [title] => sometitle ) Files: Array ( [file] => Array ( [name] => onsubmit.php [type] => text/php [tmp_name] => /var/tmp/php7ISaZd [error] => 0 [size] => 124 ) ) I'm using Mac OS X 10.4.5 with Apache, accessing it locally.
That's correct; I need to track down the problem more fully when I have some more time; in the meantime I figured I should make the diagnostic script clear that it _is_ working this way.
Created attachment 7966 [details] Upload form containing onsubmit
Upon further investigation, this only happens if the form being submitted has its visibility set to "none" (demonstrated in attachment 7966 [details]).
Yes, display:none file input controls are a known bug... Judging form the comments there, WebKit may be not violating the standard, but it is clearly in disagreement with other browsers. *** This bug has been marked as a duplicate of 5196 ***