ajax로 파일업로드할떄


contentType: false


없으면 아래와 같은 에러가 뜸.


심각: Servlet.service() for servlet [appServlet] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.web.multipart.MultipartException: The current request is not a multipart request] with root cause

org.springframework.web.multipart.MultipartException: The current request is not a multipart request


또한 


processData: false


이 없으면 아래와 같은 에러가 뜸.


Uncaught TypeError: Illegal invocation jquery-1.11.0.js:4

e jquery-1.11.0.js:4

Wc jquery-1.11.0.js:4

n.param jquery-1.11.0.js:4

n.extend.ajax jquery-1.11.0.js:4

(anonymous function) peno.js:115

n.event.dispatch jquery-1.11.0.js:3

r.handle


결론: ajax로 파일 업로드할 때는 

contentType: false

processData: false


두개 꼭 넣어주도록 하자

Posted by 타다키치
,