suppose we have a pdf link \"http://manuals.info.apple.com/en/iphone_user_guide.pdf\"(just for example and to let u know that file is not on my server, i only have the link)
Here is the perfect example of downloading a file using javaScript.
Usage: download_file(fileURL, fileName);
download_file(fileURL, fileName);