关于spring的MultipartFile可以支持的contentType?

练习用ajax上传文件,后端spring来接收,一直各种毛病啊
报错 org.springframework.web.HttpMediaTypeNotSupportedException:
Content type 'multipart/form-data' not supported

我也不懂啊,就在前端contextType各种改改改,
它也只是变着法的告诉我not supported

它到底支持个啥?

那要想在后端的作为@ResponseBody的MultipartFile接收到数据
前端的$.ajax中的contentType属性要怎么改?

multipart/form-data是表单类型的一种,不是文件类型的一种

我也有一个差不多的问题,前端的表单序列化后往后台传,@requserBody接收不到,简直要炸了,springMVC传表单对象就不能像struts2一样简单一点吗

https://www.dexcoder.com/selfly/article/337

我想是不是少了form表单设置的片段,如下:

 <form id="dynInfoUpload" enctype="multipart/form-data" method="post" action="">
                                <input accept="image/*" id="uploadImage" type="file" style="display:none">
                                <img ng-show="viewPreviewPicture != null || infoDynamic.baseInfor.picture != null" ng-src="{{viewPreviewPicture || infoDynamic.baseInfor.picture || '//:0' }}" id="previewImg">
                            </form>