Well, I asked and answered my own question, and the problem seems to be solved. The source of this problem is using teacher Ruan Yifeng’s article http://www.ruanyifeng.com/blog/2012/08/file_upload.html For front desk use With these APIs, which are much more mature than a few years ago, images will be dynamically encoded into base64 format data. As we all know, as long as it is related to transferring files, we will think of the problem of transmission format: the encoding when transferring files will become Into: multipart/form-data The data posted in this format will not be encoded like ordinary post submissions. The body of the post in this format is unencoded binary data For more information, see here: http:// www.dewen.net.cn/q/7129 And when receiving jsp in the background, it is also stored directly in the byte and written to the file that needs to be generated Just like the picture:
This method is suitable for transferring small pictures and files. As for large ones, I haven’t tried it yet, but it is foreseeable:
Just use base64 to parse the base64 data. Why convert it into characters?
Try converting ASCII to UTF-8..
Well, I asked and answered my own question, and the problem seems to be solved. The source of this problem is using teacher Ruan Yifeng’s article http://www.ruanyifeng.com/blog/2012/08/file_upload.html
This method is suitable for transferring small pictures and files. As for large ones, I haven’t tried it yet, but it is foreseeable:For front desk use With these APIs, which are much more mature than a few years ago, images will be dynamically encoded into base64 format data. As we all know, as long as it is related to transferring files, we will think of the problem of transmission format: the encoding when transferring files will become Into: multipart/form-data
The data posted in this format will not be encoded like ordinary post submissions.
The body of the post in this format is unencoded binary data
For more information, see here: http:// www.dewen.net.cn/q/7129
And when receiving jsp in the background, it is also stored directly in the byte and written to the file that needs to be generated
Just like the picture:
The performance is not that good