Last Comment Bug 111963 - Empty file inputs are not successful, but used to be[form sub]
: Empty file inputs are not successful, but used to be[form sub]
Status: VERIFIED FIXED
: regression, testcase
Product: Core
Classification: Components
Component: HTML: Form Submission (show other bugs)
: Trunk
: All All
: -- normal (vote)
: ---
Assigned To: John Keiser (jkeiser)
: Vladimir Ermakov
Mentors:
: 112202 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-26 09:01 PST by jsp
Modified: 2002-01-09 14:56 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Stub test case. (963 bytes, text/html)
2001-11-26 10:29 PST, jsp
no flags Details
Fix (736 bytes, patch)
2001-11-28 00:13 PST, John Keiser (jkeiser)
alexsavulov: review+
jst: superreview+
Details | Diff | Splinter Review

Description jsp 2001-11-26 09:01:34 PST
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.
Comment 1 jsp 2001-11-26 10:29:26 PST
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.
Comment 2 John Keiser (jkeiser) 2001-11-26 12:05:55 PST
Taking.  I did this on purpose, I was under the impression that the old code did
this.  Simple change in nsHTMLInputElement::IsSuccessful().
Comment 3 Olivier Cahagne 2001-11-27 03:42:38 PST
*** Bug 111998 has been marked as a duplicate of this bug. ***
Comment 4 Olivier Cahagne 2001-11-27 03:43:58 PST
Can you look at bug 111998 ? It's a blocker to me as it makes SourceForge File
Release unusable.
Comment 5 John Keiser (jkeiser) 2001-11-27 09:21:20 PST
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=).
Comment 6 John Keiser (jkeiser) 2001-11-27 13:04:03 PST
*** Bug 112202 has been marked as a duplicate of this bug. ***
Comment 7 John Keiser (jkeiser) 2001-11-28 00:13:09 PST
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 8 Johnny Stenback (:jst, jst@mozilla.com) 2001-11-28 00:42:46 PST
Comment on attachment 59495 [details] [diff] [review]
Fix

sr=jst
Comment 9 Alexandru Savulov 2001-11-28 11:18:08 PST
Comment on attachment 59495 [details] [diff] [review]
Fix

r= alexsavulov
Comment 10 John Keiser (jkeiser) 2001-11-28 20:06:02 PST
Fix checked in.
Comment 11 jsp 2001-11-29 10:27:19 PST
Works for me with 2001112903 on Windows 2000.
Comment 12 Vladimir Ermakov 2002-01-09 14:56:15 PST
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" 

Note You need to log in before you can comment on or make changes to this bug.