Table of contents
- 1. Syntax
- 2. Parameters
- 3. Method overview
- 4. Methods
- 4.1. append()
- 5. See also
- 6. Browser compatibility
- 6.1. Gecko notes
XMLHttpRequest Level 2 adds support for the new FormData interface. FormData objects provide a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using the XMLHttpRequest send() method.
It uses the same format a form would use if the encoding type were set to "multipart/form-data".
For details on how to use the FormData object, see Using FormData objects.
Syntax
new FormData ([in HTMLFormElement form])
Parameters
form- (optional) HTML Form Element <form> to send for keys/values. It will also encode file input content.
Method overview
void append(in DOMString name, in |
Methods
append()
Appends a key/value pair to the FormData object.
void append( in DOMString name, in nsIVariant value );
Parameters
Notes
If you specify a Blob
as the data to append to the FormData object, the filename that will be reported to the server in the "Content-Disposition" header will vary from browser to browser. See the Browser compatibility section for details.
Browser compatibility
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 7+ | 4.0 (2.0) | 10+ | 12+ | 5+ |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
|---|---|---|---|---|---|
| Basic support | 3.0 | 4.0 (2.0) | ? | ? | ? |
Gecko notes
Prior to Gecko 7.0 (Firefox 7.0 / Thunderbird 7.0 / SeaMonkey 2.4)
, if you specified a Blob
as the data to append to the object, the filename reported in the "Content-Disposition" HTTP header was an empty string; this resulted in errors being reported by some servers. Starting in Gecko 7.0, the filename "blob" is sent.


Mozilla Developer Network