<Form>
내부 데이터를 가져오거나 새로운 데이터 생성 가능<bean class="org.springframework.web.multipart.commons.CommonsMultipartResolver" id="multipartResolver"/>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.4</version>
</dependency>
formData.append(key, value, [filename]);
formData.append("name", "홍길동");
formData.append("name", "김유신");
// ["홍길동", "김유신"]
formData.delete(key);
formData.entries()
var formData = new FormData();
formData.append('이름','홍길동');
formData.append('나이','24세');
for(var pair of formData.entries()) {
console.log(pair[0]+ ', '+ pair[1]);
} // 키 // 값
formData.get()
formData.append('username', '홍길동');
formData.get('username'); // 반환값: 홍길동
formData.set(key, value[, filename])
formData("username", "홍길동")
formData.values()
var formData = new FormData();
formData.append('이름','홍길동');
formData.append('나이','24세');
for (var value of formData.values()) {
console.log(value);
}
<form id="test">
<input type="text" name="ename">
<input type="text" name="deptno">
</form>
<script>
var form = $("#test")[0]
var data = new FormData()
$.ajax({
url: "어쩌구",
data: data,
processData: false,
contentType: false,
type:'post',
success: function(){
...
}
})
</script>
type을 간과하기 쉬우니 주의