Closed Bug 116494 Opened 23 years ago Closed 23 years ago

multipart/form-data forms won't submit if there are no files in some of the file input fields

Categories

(Core :: DOM: Core & HTML, defect)

x86
Windows 98
defect
Not set
major

Tracking

()

VERIFIED DUPLICATE of bug 116210

People

(Reporter: dan, Assigned: alexsavulov)

References

()

Details

Go to the URL I provided as a test case.  Try to submit the form without
choosing a file in either of the file input fields.  In build 2001122106,
Mozilla doesn't do anything; it doesn't appear to even be attempting to submit
the form.

Now try selecting a file in the File 2 field (leaving file 1 unselected).  In
this case, it tries to submit the form, and the Mozilla icon and mouse cursor go
into the "waiting" state, but it stays that way forever (or at least as long as
I was willing to wait before I interrupted it).

It works OK with both files selected, or with only File 1 selected.

This might be related to bug 92946, but it happens on nonsecure sites as well as
secure ones, and (in the case where neither file is selected) seems to prevent
form submission without it even getting partially complete.  Anyway, I think
that other bug may actually have gone away (though it's still shown as open),
since it's been months since I remember encountering it until this bug turned up
recently.

This is a highly annoying bug, as it makes parts of an intranet I use (and
develop) unuseable in Mozilla.
*** Bug 116527 has been marked as a duplicate of this bug. ***
I experience this as well using the 0.9.7 release on Win2000, except that when 
only File 1 is selected the behavior is the same as when no files are selected.

If I enter a file name of some non-existing file, the behavior is as if the 
file name has not been entered/selected at all.

This is indeed a very annoying bug.
After experiencing the mentioned symptoms on my WInNT 4.0 SP6a machine I ran
some test on my webserver.
I used one file field and even then it wouldn't work when no file was selected,
Mozilla would just enter some waiting state (without any apparent usage of CPU
or accumulation of resources).
Webserver logs says the request never made it to the server, but removal of the
enctype="multipart/form-data" in the form tag solved that (at the price of
breaking the upload). I am reverting to 0.9.6 for now.

Thanx and best wishes
I also see this problem with the nightly builds.  Netscape 6.2.1 doesn't exhibit
this problem.  Here's the test case I used:

------
<html><body>
<form ACTION="phpinfo.php" METHOD="POST" ENCTYPE="multipart/form-data">
<input TYPE=FILE NAME="Attach">

<textarea name="Content">
</textarea>

<input TYPE=SUBMIT VALUE="Create">
</form>
</body>
</html>
------

Clicking create with no file selected enters the waiting state.
If you remove the <textarea></textarea> from this testcase and click create, it
does nothing, doesn't even enter the waiting state.

Happens with both the linux tarball(from 12/22) and Redhat RPMs(from 12/20).
*** This bug has been confirmed by popular vote. ***
Status: UNCONFIRMED → NEW
Ever confirmed: true
Confirming this bug in MacOS build 2001122408

Also, the same thing happens if you have only one file upload field (you don't
need two).
This is fixed on trunk. Confirming by popular vote is nice, searching for dups 
first is even nicer.

*** This bug has been marked as a duplicate of 116210 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
verifying
Status: RESOLVED → VERIFIED
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.