How does jquery’s progress bar for uploading pictures relate to the actual situation in the background?

  java, question

How does jquery’s progress bar for uploading pictures relate to the actual situation in the background?

http://blog.csdn.net/watertofish/article/details/6741311
There is a similar problem, the basic principle is the same. Uploading pictures/files requires asynchronous operation, otherwise the form will be submitted directly and there will be no progress bar. When uploading a file, it is not submitted all of a sudden. It is because of the restrictions on network packets in TCP/IP protocol, so the server will do corresponding write operations every time it receives part of the uploaded data. What you need to do is to write the details of this write operation into the user session after this write operation (i.e. Picture A has 512KB written). The page can know the progress by accessing the user session asynchronously.