Android uses xUtils3 upload pictures to solve the error: java.lang.ArrayIndexOutOfBoundsException: 70918

 

Today in the use of Android xUtils3 frame with SmartUpload frame upload pictures to the Java server encountered a baffling error:

Andrews end code is as follows:

It does not seem to find what the problem was at the time with xUtils2.6 old version is written like this, can upload.

After the source code comparison found online, xUtils3 framework multipart attribute is not turned on by default.

We need to set the multipart encoded manually:

Code is set as follows:

Just add a line of code on it:

 param.setMultipart(true);

Finally, the successful resolution of the problem

 

Guess you like

Origin www.cnblogs.com/xindekaishi/p/11332014.html