Dandy Dandy 1, 11 11 silver badges 25 25 bronze badges. What you can do is of course tell the user about the possibility to turn on asking for download location in the browser. Could you please share Leo how we could do that? Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Who owns this outage? Building intelligent escalation chains for modern SRE.
Podcast Who is building clouds for the independent developer? Featured on Meta. Now live: A fully responsive profile. Reducing the weight of our footer. Linked 0.
See more linked questions. Related Hot Network Questions. At this time we make the hidden spinner DIV visible and allow it take over the screen note position absolute in style. After the file downloads, it is given to the user and the. All done with client side javascript! You can't do that using just client script, because there is no event for when the download completes.
You would have to download the file through a proxy page on the server, with a unique identity in the URL so that each download could be identified. Then you could send AJAX requests from the script to the server to determine the status of the download. This code works for jQuery, but with simple modification also for javascript. With this you won't need to change your requests-codes at all.
This last line makes, that every request sent by your web application, executes the function "showAnimation" at the beginning and executes the function "hideAnimation", when the request is done. Note: In case you have some frequent updating on your website, which you don't want to show that animation for, just make the displaying of the animation dependent from a global variable, which you set to false before sending those special requests, which you don't want the animation to be shown for.
And don't forget to set it to true, when the request is done by them. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 10 years, 7 months ago. Active 2 years, 11 months ago. Viewed 22k times. Now, I want to show a spinner until the file dialog appears. We want to download a file when we click on an anchor tag link Download this file. Implementation and Folder structure is as shown below.
Skip to content. Change Language. Related Articles. Table of Contents. Save Article. Improve Article. Like Article. Download File Using. Download this file.
0コメント