New issue
Advanced search Search tips

Issue 840714 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Jul 18
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Empty <input type=file> is represented incorrectly in FormData

Project Member Reported by annevank...@gmail.com, May 8 2018

Issue description

Test: https://github.com/w3c/web-platform-tests/pull/10865. (Discovered while making an editorial change to the HTML Standard: https://github.com/whatwg/html/pull/3658.)
 

Comment 1 by tkent@chromium.org, May 9 2018

Components: -Blink>HTML Blink>Forms>File
Labels: Hotlist-GoodFirstBug
Status: Available (was: Unconfirmed)

Relevant code:
* FileInputType::AppendToFormData() in blink/renderer/core/html/forms/file_input_type.cc
* Factories in blink/renderer/core/fileapi/file.*
Project Member

Comment 2 by bugdroid1@chromium.org, Jul 18

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5b7648dcf47af986f69d54b9a6011f51a8092020

commit 5b7648dcf47af986f69d54b9a6011f51a8092020
Author: Amos Lim <eui-sang.lim@samsung.com>
Date: Wed Jul 18 03:57:03 2018

Set "application/octet-stream" content type for empty <input type=file>

Empty <input type=file> is represented incorrectly in FormData.
If there are no selected files, then append an entry to entry
list with name and a new File object with an empty name,
application/octet-stream as type, and an empty body [1].

[1] https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#constructing-form-data-set

Bug:  840714 
Change-Id: Ifadade1e260e0314664549df2d35f0cd38c76bea
Reviewed-on: https://chromium-review.googlesource.com/1140236
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575931}
[delete] https://crrev.com/21289d5be9936171c5ed5d8a0c8e7ed361f971f1/third_party/WebKit/LayoutTests/external/wpt/html/semantics/forms/form-submission-0/form-data-set-empty-file.window-expected.txt
[modify] https://crrev.com/5b7648dcf47af986f69d54b9a6011f51a8092020/third_party/blink/renderer/core/fileapi/file.cc

Owner: eui-sang.lim@samsung.com
Status: Fixed (was: Available)
Labels: Target-69

Sign in to add a comment