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 22680 - forms: Make FormData expose its contents
Summary: forms: Make FormData expose its contents
Status: RESOLVED DUPLICATE of bug 23211
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 enhancement
Target Milestone: Needs Impl Interest
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-15 23:47 UTC by Ian 'Hixie' Hickson
Modified: 2014-05-16 11:16 UTC (History)
4 users (show)

See Also:


Attachments

Description Ian 'Hixie' Hickson 2013-07-15 23:47:56 UTC
Right now there's no easy way to walk a <form>'s form data set. Extending FormData to actually expose the form data seems like the obvious choice.
Comment 1 Ian 'Hixie' Hickson 2013-07-15 23:49:29 UTC
See also: http://wiki.whatwg.org/wiki/FormData
Comment 2 Arun 2013-07-16 16:32:15 UTC
Bug 20887 proposes to add a File constructor.  If we did, it seems like you could walk a <form>'s form data set, extract file data, and use it to create a File object.  Should there be a more intuitive connection between File and FormData?
Comment 3 Ian 'Hixie' Hickson 2013-07-16 23:13:39 UTC
Arun, can you elaborate? I'm not sure I follow.
Comment 4 Arun 2013-08-15 16:43:24 UTC
(Sorry for the tardy response: I was on vacation).

I've mulled this over, and think a File constructor is sufficient; Bug 20887 now has some spec. text in place, and should hopefully come as no surprise:

var f = new File(myBlob, "fooBarFile");

There shouldn't be too many other requirements that FormData has on File, so Comment 2 was out of turn I think.
Comment 5 Anne 2013-08-28 08:50:16 UTC
See also bug 20038 by the way.
Comment 6 Anne 2013-09-10 16:58:16 UTC
The other bug is fixed now. But since JavaScript has no iterators yet there's no way to iterate FormData thus far... Not sure if we want to keep this bug open for that or not. Once iterators are there we'll update a whole bunch of objects I think.
Comment 7 Ian 'Hixie' Hickson 2014-05-15 22:43:38 UTC
Anne, should this bug be yours at this point, since you own that API?
Comment 8 Anne 2014-05-16 11:16:18 UTC
It already exposes contents, but iterating over the contents is awaiting some new IDL sugar. Let's just dupe this against that remaining bit.

*** This bug has been marked as a duplicate of bug 23211 ***