How to detect when a download is complete

  • Thread starter barthelemy.von.haller
  • Start date
B

barthelemy.von.haller

Hi all,

I googled and read this group but could not find any solution to my
problem.

I have a page to download big excel files that we 'build' on the
server side. When a user click on the link to download, he has no clue
that something is going on (and it can take some time). Indeed if the
cursor is over some text or some special parts of the page it will not
be set to the 'progress' type.

Therefore I thought I could just set the cursor type to 'progress'
with javascript when the user click and to set it back to default when
the download is complete. Unfortunately it doesn't seem to be possible
to know when a download is complete. Could you confirm that ? or does
anybody know a solution ?

Then, how should I do ?
some artificial AJAX call to have the possibility to have a callback
function ?
any other idea ?

Thanks in advance for your help.

Barth
 
V

VK

Hi all,

I googled and read this group but could not find any solution to my
problem.

I have a page to download big excel files that we 'build' on the
server side. When a user click on the link to download, he has no clue
that something is going on (and it can take some time). Indeed if the
cursor is over some text or some special parts of the page it will not
be set to the 'progress' type.

Therefore I thought I could just set the cursor type to 'progress'
with javascript when the user click and to set it back to default when
the download is complete. Unfortunately it doesn't seem to be possible
to know when a download is complete. Could you confirm that ? or does
anybody know a solution ?

Then, how should I do ?
some artificial AJAX call to have the possibility to have a callback
function ?
any other idea ?

Thanks in advance for your help.

If you are using the regular way so on link click you are sending
server response with Content-type "application/vnd.ms-excel" then user
will get popup Open/Save dialog and on either choice she will see some
progress going on: either Excel launched and loading file or floating
popup with download progress.
If you are using some other way to serve Excel files from the server
then a bit of more details are needed.
 
B

barthelemy.von.haller

If you are using the regular way so on link click you are sending
server response with Content-type "application/vnd.ms-excel" then user
will get popup Open/Save dialog and on either choice she will see some
progress going on: either Excel launched and loading file or floating
popup with download progress.
If you are using some other way to serve Excel files from the server
then a bit of more details are needed.

We do as you say but the problem is that it takes a long time between
the click of the user and the popup Open/Save.
A lot of things have to be done to generate the excel file. During
this period, before the popup, the user has no indication that their
clic has been taken into account.
So I thought I could change the cursor shape on the clic and then
change it back later, when the download terminates per instance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,608
Members
45,247
Latest member
crypto tax software1

Latest Threads

Top