How to Force PDF File Auto Download

How to Force PDF File Auto Download

This Tutorial i will Focus How to Force PDF File Auto Download

Today i am working in a wordpress project and my client want, When someone click on the PDF File i will start Downloading. Searches many blocks and plugins but could not find that i wanted.
Always i prefer to use functions Because all Free plugins are not save for site. then i found a code at https://stackoverflow.com 

You put the following code in your .htaccess file:

But you should do it by FTP or Cpanel if you have enough knowledge, Check this out how to edit .htaccess

How to Force PDF File Auto Download

How to Force PDF File Auto Download

Right Click and click Edit, paste the below code after the <IfModule mod_rewrite.c>...</IfModule>

Save the file and done 🙂

I believe this way PDF File Auto Download will be start.

Note: Its better to add the above code via ftp or cpanel for save side.

Md. Elias
elias1435@gmail.com
No Comments

Post A Comment