Download file from web application

Download file from web application

Hi,
 
I am creating a web application using ASP.NET and C#.
 
In my webpage, i have a download button. On click of it, I am trying to download a file. I am passing the complete URL of file (example: http://sitename/foldername/filename.zip)
 
However the download is not working. Below is the code used:
 
 
  1. //aspx page
    <input type= "image" id="ImgDownload" src="Imagesrc" />
  2. // javascript file
    $(document).ready(function () {
     $('#ImgDownload').click(function () {
            FetchURL();


  3.         return false;  // called to ensure there is no postback
  4.     });
    });
  5. function FetchURL(){
      var url = file full URL;
  6.     downloadURL(url);
    }
  7. function downloadURL(url) {
        var hiddenIFrameID = 'hiddenDownloader',
            iframe = document.getElementById(hiddenIFrameID);
        if (iframe === null) {
            iframe = document.createElement('iframe');
            iframe.id = hiddenIFrameID;
            iframe.style.display = 'none';
            document.body.appendChild(iframe);
        }
        iframe.src = url;
    };









The downloadURL function was taken from stackoverflow forum, in which the users had marked the code as answer. However,I am not able to use it correctly.
 
 
 
How to download file using jQuery?
Thanks