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

VERIFIED FIXED

Status

()

Core
HTML: Form Submission
VERIFIED FIXED
16 years ago
16 years ago

People

(Reporter: jsp, Assigned: John Keiser (jkeiser))

Tracking

({regression, testcase})

Trunk
regression, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

(Reporter)

Description

16 years ago
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.

Updated

16 years ago
Summary: Empty file inputs are not successful, but used to be → Empty file inputs are not successful, but used to be[form sub]
(Reporter)

Comment 1

16 years ago
Created attachment 59177 [details]
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.

Updated

16 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
(Assignee)

Comment 2

16 years ago
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

Comment 3

16 years ago
*** Bug 111998 has been marked as a duplicate of this bug. ***

Comment 4

16 years ago
Can you look at bug 111998 ? It's a blocker to me as it makes SourceForge File
Release unusable.
Keywords: regression, testcase
(Assignee)

Comment 5

16 years ago
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=).
(Assignee)

Comment 6

16 years ago
*** Bug 112202 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 7

16 years ago
Created attachment 59495 [details] [diff] [review]
Fix

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 9

16 years ago
Comment on attachment 59495 [details] [diff] [review]
Fix

r= alexsavulov
Attachment #59495 - Flags: review+
(Assignee)

Comment 10

16 years ago
Fix checked in.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
(Reporter)

Comment 11

16 years ago
Works for me with 2001112903 on Windows 2000.

Comment 12

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