티스토리 뷰

웹/JS&JQUERY&AJAX

AJAX 파일 전송 오류

논현동거지 2018. 8. 9. 16:40

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


두개 꼭 넣어주도록 하자



출처: http://tadakichi.tistory.com/75 [버그잡는 타다키치]

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함