Closed
Bug 702949
Opened 13 years ago
Closed 12 years ago
<input type="file"> doesn't submit form in case of filling wrong filename
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla22
People
(Reporter: karel.sluka, Assigned: mounir)
References
Details
Attachments
(1 file, 1 obsolete file)
4.74 KB,
patch
|
sicking
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2
Steps to reproduce:
I clicked on input to upload a file. I selected the file from Open dialog box and confirmed it. After confirming dialog the file I have chosen was removed from the filesystem. As last step I submited the form.
Actual results:
No request was sent to the server.
Expected results:
Send request to the server according resource defined in form action attribute. (This worked in Firefox 3.6 but not later).
Updated•13 years ago
|
Component: General → HTML: Form Submission
QA Contact: general → form-submission
Reporter | ||
Updated•13 years ago
|
Severity: normal → critical
Updated•13 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 1•13 years ago
|
||
Jonas, Jignesh has narrowed down where this is failing. We're now looking at the correct way to deal with this - my instinct is to create an empty stream instead of the file stream, but Chrome apparently discards the entire input element from the form submission and displays a warning indicating as such. Is this specced at all?
Comment 2•13 years ago
|
||
Nevermind about the Chrome behaviour - that was actually Zimbra's warning, not the browser's.
Comment 3•13 years ago
|
||
Looks like Chrome submits an empty file.
Submitting an empty file sounds like an ok solution to me. Alternatively we could use the form-validation code to focus the file control and let the user choose a new file.
Assignee | ||
Comment 5•13 years ago
|
||
(In reply to Jonas Sicking (:sicking) from comment #4)
> Submitting an empty file sounds like an ok solution to me. Alternatively we
> could use the form-validation code to focus the file control and let the
> user choose a new file.
Using the form validation mechanism to say "The file you are trying to upload has been deleted in the meantime, please select a new one." seems way nicer regarding UX but do we really care for such an edge case?
Hmm.. the problem is that we need to check synchronously, so yeah, probably not worth doing.
Submitting an empty file seems like an improvement though.
Comment 7•13 years ago
|
||
I wonder whether we could open the file at the time immediately after it is picked, in order to keep a handle on the file that will be valid after it is unlinked.
At least that is the Unix behavior; I'm not sure of the NT behavior; perhaps on NT the handle would prevent the file from being deleted, which would also be fine.
Comment 8•12 years ago
|
||
An older report: bug 479429.
Comment 9•12 years ago
|
||
(In reply to Aleksej [:Aleksej] from comment #8)
Please ignore that, wrong bug, sorry.
Assignee | ||
Updated•12 years ago
|
Severity: critical → normal
OS: Windows 7 → All
Hardware: x86_64 → All
Version: unspecified → Trunk
Assignee | ||
Comment 11•12 years ago
|
||
Comment on attachment 720475 [details] [diff] [review]
Patch
This will cause sync IO.
Attachment #720475 -
Flags: review?(jonas) → review-
Assignee | ||
Comment 13•12 years ago
|
||
Using aBlob->GetSize() as the current code does. Though, it's not clear to me why this wouldn't do IO unless the file is cached somehow. Anyway, keeping the same method is probably better.
Attachment #720475 -
Attachment is obsolete: true
Attachment #720490 -
Flags: review?(jonas)
Attachment #720490 -
Flags: review?(jonas) → review+
Assignee | ||
Comment 14•12 years ago
|
||
Flags: in-testsuite+
Target Milestone: --- → mozilla22
Comment 15•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Summary: <input type="file" doesn't submit form in case of filling wrong filename → <input type="file"> doesn't submit form in case of filling wrong filename
Updated•6 years ago
|
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•