[Translation] ASP.NET (C #) file upload progress bar

xiaoxiao2021-03-06  90

Author: azamsharp translation: sharpcn Description: A few days ago, I saw on a forum "How to create a file upload progress bar" issue. Let me know that we have controls for uploading client files to server-side, but this control does not provide any information about uploading progress. If the client is uploaded (especially big files), there is no change on the page, it is not easy to know if the upload operation is in progress, and how much is not over. The solution is to use some technical methods to display upload progress on the client. Background knowledge: In this article, I don't tell "how to upload the file to the server". Recommend a wonderful article to Konstantin Vasserman: "Upload File with ASP.NET". I want to say a few words about the server upload. If the client does not submit a resource request to the server side, the server side will not send any information to the client, so the progress message uploaded to the client is not possible. In order to solve this problem, we must let the client send requests to the server. The following small segment JavaScript code will relax the request to the server after 2 seconds.