springboot file transfer problems Kingdee Middleware

Problem Description: end interface parameters @RequestParam ( "pic") MultipartFile files1 
request is a format key is formdata "pic", value for the file body. Kingdee environment Kylin + TY middleware.
In this test writing can successfully received on the windows + tomcat, windows + Kingdee, Kirin + tomcat to upload files;
but in Kirin + Kingdee environment, that can not get the file. print
((MultipartHttpServletRequest) request) .getFiles ( "pic") size ();. 

The output is 0. No arguments?
Filter intercepts request.getInpitSteram ()
Content-Disposition: form-data; name="pic"; filename="u=1340423812,3904815246&fm=27&gp=0 - 副本.jpg"
Content-Type: image/jpeg
 
? C ???? JFIF ?????????? ?

 $.' ",#(7),01444'9=82<.342��C			
 
2!!22222222222222222222222222222222222222222222222222����"��	
���}!1AQa"q2���#B��R��$3br�	
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������������������������������	
���w!1AQaq"2�B����	#3R�br�
$4�%�&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz��������������������������������������������������������������������������?�L��Q��IEkd���Q��EQ`��b�5.M%�?�Q�IEɥɤ����4��X�hi)(���2i)iY�4d��EYd�sJi(�.h�(�&��(�&�M%d挜�⒍\�j2h��&�&������Rd�QFh�riCIN�.M?�RQN�;vhɦ�ҰM����\�\�QHB�ѓI@�b�ѓ�ERn�8�'��J)��4��Xɤɢ�Z\�2z�Q@M4QLq�&��Rn?�QE�J(��Š);��EQE�R�@.)(�������P)�SE:�qHx���RR�@���
)-%-PE�b�QE��������
(�.((��\���RR�L�-%.h��)��Q@��(��J(��%-(��(��R⒐Š(�RPi)�ZJZ(���
(?% - 'the`?
 
-�J)h��&)h��KIE 
(?? Q @?
)(���(h��xӖpg�:����;��p�����JJ���:=��$��'�)/������]܈$y"���Qq=���e�YjP�m.b�ulռsLQE�
(�����JJZ()E��0
)qF)�)��S@���
?? E? TQE? (? JZJ (? E? S? I) (4 ((? 1 æM% Q p4 ?? @? h (?
QIK@-%-چ������T�5�
��k�Z;�o���n�JWW={�mP�<���q\Υ�E��Ԕ�މҼKY�U�����������
�������<òG���Z,����9�>����	4h����:'q ��S;�u\������x���r��0+����&�۹��M�p>���J�"?^��vK��R>����fV�Cg=�J
�0bz�t�����N?�♉�`APphi��ٱ�P�a5��m�z#��K���m{L�>�ui�Y�7��	�׍�Ą園(YI~J���+��Yh�7е�e��О��ڊ��s��bs�3_)�~$}u!b�F+�t��Z>�����
? ~ = HI3M% y 浃? F $ 9BYO ڴ4_ Zu ܟ f1mp? 3OMI? / Zdr $ z # ` iDE ??? f%? R? qE: J1KE! E -?% - ?? IE? RRP? E ???) R) QE ?? -%? R? Z (@ 2v) 1L ?? ? 4RR? i ?? P? @} nC {5? (? @? $ ?? PkM - ???? Z {== 8 $? 3 l?) ??? OA ^ ߈ | ak #)? gŧn * ݇ CO7: ^? # Y qfM) <> ơV + ??? f ^:
�$�4Ŧ�­O���yQF�G����F$I��r[/X�wW�*�n�z��[��i13Klf�װ�t��F6�4C��E�jv�a�k��	��w��KvQ�դ��[��9g��yn�caG���6��.��U1�y9��ygܩ��T��XY	Y�
MQ�s&8�*H�n\�ӽXm.tPeM�ո�,U�8��@����6�f`���Ni����͞qQ�;I/��SG+	��b8Ҟ���}ޘ��M�N.�8�&���<'��r:i���H��MĘ
[sZu;?% ?: ~ bn $ #} sM P1Z) Hu; m6 \ e / x? [h32? 

obviously there are documents passed in!
Why not go to MultipartHttpServletRequest up?

Solution:
Under the corresponding @Configuration a new configuration @Bean
@Bean (name = "the MultipartResolver") 
public the MultipartResolver the MultipartResolver () {
the CommonsMultipartResolver the CommonsMultipartResolver Resolver new new = ();
resolver.setDefaultEncoding ( "UTF-. 8");
UploadAction // resolveLazily property in order to enable the file parsing delayed, in the order captured file size exception
resolver.setResolveLazily (to true);
resolver.setMaxInMemorySize (40960);
// upload file size 1024 * 1024 * 50 50M
resolver.setMaxUploadSize (50 * 1024 * 1024);
return Resolver;
}
Custom MultipartResolver passed a framework (property set no nothing to do with this issue, I set up here), Haoshi up! 666 
just on the windows + tomcat, windows + Kingdee, unicorn + tomcat not be used, use of the environment are mutually exclusive? ! ! !

The next day the study reason
MultipartResolver is an interface, the implementation of which is shown below, is divided into classes, and StandardServletMultipartResolver CommonsMultipartResolver class.

 

After testing @Bean given StandardServletMultipartResolver does not help, just give CommonsMultipartResolver to do so,

First down.



Guess you like

Origin www.cnblogs.com/tyhc/p/11911115.html