Closed Bug 111963 Opened 23 years ago Closed 23 years ago

Empty file inputs are not successful, but used to be[form sub]

Categories

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

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: jsp, Assigned: john)

References

Details

(Keywords: regression, testcase)

Attachments

(2 files)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.6+)
Gecko/20011126
BuildID:    2001112603

Prior to 0.9.6, an empty file input was submitted. With 0.9.6 and later builds,
file inputs are submitted only if the user specifies a file name. While this is
allowed (see http://www.w3.org/TR/html4/interact/forms.html#h-17.13.2), it's not
required, and it's inconsistent with IE and previous versions of Mozilla.

Reproducible: Always
Steps to Reproduce:
1. Create a form with a file input that submits to a server you can debug.
2. Submit the form without specifying a file.
3. Inspect the request received by the server.

Actual Results:  The file input's data is absent from the request.

Expected Results:  The file input should be represented as a name=value pair in
the request, with an empty value.

I tested this on Windows 2000 and Mac OS 9.0.4.
Summary: Empty file inputs are not successful, but used to be → Empty file inputs are not successful, but used to be[form sub]
Attached file Stub test case.
This attachment provides a shell for a test case; the form must be modified to
submit its data to a script that does something useful like displaying the
message body.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Taking.  I did this on purpose, I was under the impression that the old code did
this.  Simple change in nsHTMLInputElement::IsSuccessful().
Assignee: alexsavulov → jkeiser
*** Bug 111998 has been marked as a duplicate of this bug. ***
Can you look at bug 111998 ? It's a blocker to me as it makes SourceForge File
Release unusable.
Keywords: regression, testcase
It looks as though you are having the same problem.  This will be fixed tonight
or tomorrow night (depending on how fast I get r=).
*** Bug 112202 has been marked as a duplicate of this bug. ***
Attached patch FixSplinter Review
This fixes it for a POST form I wrote.	We were explicitly checking to see if
value was empty or not in IsSuccessful().  Now file controls are always
successful.
Comment on attachment 59495 [details] [diff] [review]
Fix

sr=jst
Attachment #59495 - Flags: superreview+
Comment on attachment 59495 [details] [diff] [review]
Fix

r= alexsavulov
Attachment #59495 - Flags: review+
Fix checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Works for me with 2001112903 on Windows 2000.
verifying on windows 2002-01-07-03-trunk and 2002-01-04-08-trunk.This actually
looks like a dupe of bug 116210
"File upload stalls when file name is invalid or on EACCES" 
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.

Attachment

General

Creator:
Created:
Updated:
Size: