Force a link to download instead of open pdf






















Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:.

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support! Sergey Tkachenko is a software developer from Russia who started Winaero back in On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram , Twitter , and YouTube. View all posts by Sergey Tkachenko. Your email address will not be published.

Skip to content Advertisement. Contents hide. You only need to add the rules that apply to the files you want to force to download. These command are global. Other These are other methods i have come across that might be useful to other people. Read times Last modified on Tuesday, 14 February Published in General. Something like this:. This link will open the file, either in a Web App or a Desktop Application, depending on your settings. To make the link download you need to remove some things from the copied link.

Once you paste the copied link into a hyperlink or button or whatever, just remove all text after the? You can alternatively explain to the user that they should right click on the link and select download. If you have no other alternatives to force the file to download, you can host it on a file hosting service such as Google Docs.

The most common file types that are affected by this behavior are PDF files and images. The code below will tell the browser to prompt the user to save the file. This link does not have the download attribute.



0コメント

  • 1000 / 1000