Grow your CSS skills. Land your dream job.

WordPress | Audio player – Forced Download

  • # March 1, 2013 at 4:00 pm

    Hey guys,

    My names Andy and I am an absolute novice. I’d really really appreciate any help anyone is able to give to help me fix my problem!

    I have WordPress Audio Player and I am uploading all the MP3s to my FTP, and then writing the links back into WordPress.

    I wish to host an MP3 for listening, and then a separate link (Perhaps reading ‘Download’) where users are able to download the the track without being redirected to another page and having to right click save as.

    I’m after a solution for a forced download if anyone has one?

    Thanks so much guys, really appreciate it.

    Andy

    # March 1, 2013 at 5:59 pm

    In the [.htaccess section of "Snippets"](http://css-tricks.com/snippets/htaccess) check out the title [Force Files to Download (Not Open in Browser)](http://css-tricks.com/snippets/htaccess/force-files-to-download-not-open-in-browser) and add:

    AddType application/octet-stream .mp3

    Also, there are [WordPress plugins that take care](http://wordpress.org/extend/plugins/download-shortcode/) this for you.

    Hope that helps,
    -Alen

    # March 2, 2013 at 7:40 am

    That’s great Alen! Thank you!

    I’m stuck as to what I should open, and where I should put this snippet though? I have no idea about .htaccess!
    Sorry for the lack of knowledge… Any ideas?

    # March 2, 2013 at 9:32 am

    .htaccess file is Apache server configuration file. It is hidden by default ([.] before file name in Linux means file is hidden). This file can be found at root level of your website. So whatever default directory you log-in via FTP. Most FTP clients by default ignore any file starting with [.]! So make sure your FTP program is configured to display hidden files and you’ll see .htaccess file. Then just download it, edit and re-upload overwriting the old one. (Remember to back-up original copy)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".