Bug 8584

Summary: File info is not POSTed when an onsubmit handler is present on the form
Product: WebKit Reporter: Seth Fitzsimmons <seth>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: ap, ddkilzer
Priority: P2    
Version: 420+   
Hardware: Macintosh   
OS: OS X 10.4   
Attachments:
Description Flags
Upload form containing onsubmit
none
PHP script demonstrating the absence of the "file" property
none
Better diagnostic script
none
Upload form containing onsubmit none

Description Seth Fitzsimmons 2006-04-25 06:27:51 PDT
Adding a onsubmit handler to a multipart form with a file input causes the file to not be POSTed to the server.
Comment 1 Seth Fitzsimmons 2006-04-25 06:28:29 PDT
Created attachment 7956 [details]
Upload form containing onsubmit
Comment 2 Seth Fitzsimmons 2006-04-25 06:29:06 PDT
Created attachment 7957 [details]
PHP script demonstrating the absence of the "file" property
Comment 3 Alexey Proskuryakov 2006-04-25 10:20:19 PDT
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?
Comment 4 Seth Fitzsimmons 2006-04-25 10:30:52 PDT
Er, sorry.  I need to provide a better reduction.
Comment 5 Seth Fitzsimmons 2006-04-25 10:32:28 PDT
Created attachment 7960 [details]
Better diagnostic script
Comment 6 Alexey Proskuryakov 2006-04-25 10:52:45 PDT
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.
Comment 7 Seth Fitzsimmons 2006-04-25 11:34:49 PDT
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.
Comment 8 Seth Fitzsimmons 2006-04-25 19:31:01 PDT
Created attachment 7966 [details]
Upload form containing onsubmit
Comment 9 Seth Fitzsimmons 2006-04-25 19:33:09 PDT
Upon further investigation, this only happens if the form being submitted has its visibility set to "none" (demonstrated in attachment 7966 [details]).
Comment 10 Alexey Proskuryakov 2006-04-25 21:44:55 PDT
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 ***