K
K
Kirill Zhilyaev2018-10-25 10:25:58
JavaScript
Kirill Zhilyaev, 2018-10-25 10:25:58

How does upload.onprogress work in JS?

On what basis does upload.onprogress work?
For example, I have a channel of 200 KB / s. I am sending a 10 megabyte file, and it is logical that until the file is completely sent, I will be able to make a new request. On what basis does it work? Does the server somehow respond with the amount of received data? Or I don't know something about TCP? Can I somehow get the progress for a send on a websocket?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
AlexKeller, 2018-10-25
@AlexKeller

https://learn.javascript.ru/xhr-onprogress
* The event occurs with each byte sent, but no more than once every 50 ms. This is indicated in the progress notifications specification
* The xhr.upload.onprogress event fires when the data has been submitted by the browser. But it does not guarantee that the server has received, processed, and written the data to disk. He only talks about the fact of sending

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question