cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Go to solution
Highlighted

Have a direct download link

Hello, please🙏

Is it possible to have direct download links on WordPress? I know how to add images, for example a Mp3, with a link. But when the visitor clicks the links I have created, they view it directly in the browser. Then they have to download it from there. I was wondering if it’s possible to create a link that just starts downloading a file instantly to the visitor’s computer when they click it? Without going through the extra step of viewing it first.

Thank you 😊
6 REPLIES 6
Super User III
Super User III

Re: Have a direct download link

@At9aija 

 

In your .htaccess file you would need to add lines like

 

AddType application/octet-stream .csv
AddType application/octet-stream .xls
AddType application/octet-stream .doc
AddType application/octet-stream .avi
AddType application/octet-stream .mpg
AddType application/octet-stream .mov
AddType application/octet-stream .pdf

Depending on the type of file you are working with  - this should force the file to download vs opening



I am a GoDaddy End User - Just Like You
Check out my site! | I currently manage over 300 WordPress Websites
* Please note that I offer free advice on this forum. If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

Once your issue is resolved,
please be sure to come back and click accept for the solution

Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community

Re: Have a direct download link

Thank you for the replay,
I try adding the code, but still it doesn't work.
Please provide me the code that work for MP3 and VIDEO.

Thank you
Super User III
Super User III

Re: Have a direct download link

Can you give me a link to your site so I can see what happens



I am a GoDaddy End User - Just Like You
Check out my site! | I currently manage over 300 WordPress Websites
* Please note that I offer free advice on this forum. If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

Once your issue is resolved,
please be sure to come back and click accept for the solution

Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community

Re: Have a direct download link

http://at9aija.com.ng

Or

Click DOWNLOAD Mp³ on this page➡ http://at9aija.com.ng/dj-ab-kumatu/

Thank you!❤
Super User III
Super User III
Solution

Re: Have a direct download link

@At9aija 

 

So you added this to the htaccess file

AddType application/octet-stream .mp3

You can also try

<FilesMatch "\.(?i:doc|pdf|mp3)$">
  Header set Content-Disposition attachment
</FilesMatch>

You may have to put an .htaccess file in the uploads folder where you have the MP3 file



I am a GoDaddy End User - Just Like You
Check out my site! | I currently manage over 300 WordPress Websites
* Please note that I offer free advice on this forum. If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

Once your issue is resolved,
please be sure to come back and click accept for the solution

Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community

Re: Have a direct download link

Thank you very much,
I'm much grateful.
My problem has been resolved
Thanks to RESOLVER IV.

Please do mail me privately i have something to discuss [removed]
I hope to hear from you sir🙏


One love❤