0

In my application , I have to provide a download button, so that when user clicks on it he/she can download file.

Right now in my application i have a feature that when user clicks on download button , I disable my download button until download pop-up is opened.

Now, I want that when download completes on client side , then download button should be enable to the client.

I want to know that is it possible ? If yes , then please tell me how can i achieve that.

user1428716
  • 2,078
  • 2
  • 18
  • 37
user2866134
  • 41
  • 1
  • 3
  • are you using jQuery ? Follow link here : http://stackoverflow.com/questions/1296085/download-file-using-jquery – user1428716 Jan 30 '14 at 10:17
  • Hey , My problem is that when user click on "save" button in download window , then download will be start . I want that when this download is completed then my download button should be enable. – user2866134 Jan 30 '14 at 10:43
  • There are lots of solution to it http://stackoverflow.com/questions/4545311/download-a-file-by-jquery-ajax which refers to this link http://johnculviner.com/jquery-file-download-plugin-for-ajax-like-feature-rich-file-downloads/ – user1428716 Jan 30 '14 at 11:34

1 Answers1

0

From the [link][1] i Pasted , you can do this using jQuery :

Suppose you have an

<input id="FileDownload" type="button" name="FileDownload">Download</input>

You can define a jQuery event on the Click of this button

$("#FileDownlaod").click(function(){
this.disabled=true; //Disables the input button
/Call the plugin as described in the link
//On Success this.disabled=false
});
user1428716
  • 2,078
  • 2
  • 18
  • 37