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)…now i have to provide a button on my site that will download the file.
i have tried various things like window.open, href etc. methods but it open the link on other window. i know thats because now all browser comes with a adobe plugin which opens it in another window, but still isnt there any way i give the user the option of download rather than opening it, through client side scripting ..
plz help.. thanks
Use the HTML5 “download” attribute
<a href="iphone_user_guide.pdf" download="iPhone User's Guide.PDF">click me</a>
2021 Update: Now supported in all major browsers! see: caniuse.com/#search=download