FormData.append()
The append()
method of the FormData
interface appends a new value onto an existing key inside a FormData
object, or adds the key if it does not already exist.
Syntax
append(name, value)
append(name, value, filename)
Parameters
name
- : The name of the field whose data is contained in
value
.
- : The name of the field whose data is contained in
value
- : The value of the field. This can be a string or a
Blob
(including subclasses such asFile
). If none of these, the value is converted to a string.
- : The value of the field. This can be a string or a
filename
optional- : The filename reported to the server when a
Blob
orFile
is passed as the second parameter. The default filename forBlob
objects is "blob". The default filename forFile
objects is the file's filename.
- : The filename reported to the server when a
Return value
undefined