Polling the file download server using the progress bar

This is not a duplicate of those questions that ask how to download a file and display a progress bar. My understanding of the basics:

  • We have a form that places the given input file in the specified URL.
  • Once the submit button is pressed, we set the interval to run the Javascript method every second, which uses AJAX to poll the server to get the status of this download.

The only dilemma for me here is that I tried this method, but when I look at the FireBug console, I see all these jQuery AJAX calls. I saw an implementation of other people where you don't see anything in FireBug> Net> XHR.

Does anyone have any ideas how this is implemented?

Any advice is appreciated.

Cheers, Mosh

PS: To emphasize, I am not interested in doing this with Flash.

+4
source share
4 answers

Not as easy as it sounds

I think this will be related to programming on a low-level web server, because the files are processed (downloaded) before your code is executed. It just means that you don’t have an understanding of the process of downloading files inside the server in order to poll / examine it ...

If your script should work like:

  • select File
  • send it (which starts the download)
  • Ajax poll

then you will have some problems:

  • If your Ajax requests should start from the same page, this will not work because the page has already been unloaded (the form is already submitted), this means that the scripts are likely to be stopped.
  • if you have a form with a file upload in another iframe and a poll downloaded from the parent page, you will need to implement some low-level server code to ensure what I highlighted above.

Client side plugins

To do this, it is much easier to do this on the client side using plugins such as Uploadify , which can also use Flash to get information about upload progress to the server.

+2
source

Perhaps this page may help you: a jquery ajax plugin plugin with a progress bar . Or you can search for an alternative yourself.

+1
source

It seems that these are actually several questions in one.

  • One of the improvements I can offer is the use of the Socket.io library, which uses websites and backups for long-term polling via XHR or Flash. This would at least provide a structured way to minimize survey overhead.

  • When “hidden requests” appear, they probably use a different method than XHR, if you don't see XHR, they probably don't do XHR. (It is obvious)

0
source

All Articles