Bug 8584 - File info is not POSTed when an onsubmit handler is present on the form
Summary: File info is not POSTed when an onsubmit handler is present on the form
Status: RESOLVED DUPLICATE of bug 5196
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: Macintosh OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-25 06:27 PDT by Seth Fitzsimmons
Modified: 2006-04-25 21:44 PDT (History)
2 users (show)

See Also:


Attachments
Upload form containing onsubmit (837 bytes, text/html)
2006-04-25 06:28 PDT, Seth Fitzsimmons
no flags Details
PHP script demonstrating the absence of the "file" property (30 bytes, text/plain)
2006-04-25 06:29 PDT, Seth Fitzsimmons
no flags Details
Better diagnostic script (124 bytes, text/plain)
2006-04-25 10:32 PDT, Seth Fitzsimmons
no flags Details
Upload form containing onsubmit (731 bytes, text/html)
2006-04-25 19:31 PDT, Seth Fitzsimmons
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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 ***