By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,474 Members | 3,141 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,474 IT Pros & Developers. It's quick & easy.

How to detect when a download is complete

P: n/a
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
Jan 8 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
VK
On Jan 8, 7:24 pm, barthelemy.von.hal...@gmail.com wrote:
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.
Jan 8 '08 #2

P: n/a
On Jan 8, 6:42 pm, VK <schools_r...@yahoo.comwrote:
On Jan 8, 7:24 pm, barthelemy.von.hal...@gmail.com wrote:
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.
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.
Jan 9 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.