This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10567 - How will the input name be processed for multiple files? can mime/multipart "part" names be the same?
Summary: How will the input name be processed for multiple files? can mime/multipart "...
Status: RESOLVED WORKSFORME
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-07 13:09 UTC by contributor
Modified: 2010-10-04 15:04 UTC (History)
5 users (show)

See Also:


Attachments

Description contributor 2010-09-07 13:09:33 UTC
Section: http://www.whatwg.org/specs/web-apps/current-work/#the-input-element-as-a-file-upload-control

Comment:
How will the input name be processed for multiple files? can mime/multipart
"part" names be the same?

Posted from: 80.177.128.34
Comment 1 Animal 2010-09-07 13:24:42 UTC
In the document http://www.ietf.org/rfc/rfc2388.txt

We have

3. Definition of multipart/form-data

   The media-type multipart/form-data follows the rules of all multipart
   MIME data streams as outlined in [RFC 2046].  In forms, there are a
   series of fields to be supplied by the user who fills out the form.
   Each field has a name. Within a given form, the names are unique.

   "multipart/form-data" contains a series of parts. Each part is
   expected to contain a content-disposition header [RFC 2183] where the
   disposition type is "form-data", and where the disposition contains
   an (additional) parameter of "name", where the value of that
   parameter is the original field name in the form. For example, a part
   might contain a header:

        Content-Disposition: form-data; name="user"

   with the value corresponding to the entry of the "user" field.

So how can

<input type="file" name="myPhotos" multiple="true">

be submitted?
Comment 2 Ian 'Hixie' Hickson 2010-09-26 02:40:47 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale:

RFC2388 is wrong, field names aren't necessarily unique.

<input type=file name=a multiple> with two files selected gets submitted exactly as would:

   <input type=file name=a>
   <input type=file name=a>

...each with one file selected.
Comment 3 Animal 2010-10-04 15:04:56 UTC
So there may be multuiple parts with

Content-Disposition: form-data; name="user"

As the header?

Right, I'll have to rethink my MuliPartMessage class. It use the Java Mail API to parse a multipart message, but then stashes the Parts in a HashMap keyed by the *name* part of the Content-Disposition