WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been searching high and low trying to figure out how to create download links for audio files uploaded to a post.

I know how to display the audio url directly into the theme template, but when it's clicked, it just starts to stream the audio right in the browser.

I need a way to prompt the file to download once clicked.

Looking for more of a snippet for the functions.php file than a plugin.

share|improve this question

Some people like to stream audio in the browser, others like to download. Each of them is able set up the browser to choose between downloading or streaming different MIME types to get what they need.

On the other hand you can force download of certain MIME type files using PHP header() function.

See How can I force a file download in the WordPress backend? for starting point.

share|improve this answer
Well the thing is I alreay have a audio player streaming the files, the function I'm looking for is so a user can download the audio file their listening to by simply clicking a link. – Chozen Mar 2 '13 at 19:12
Please supply your question with more information about clicking as it will be useful for other users and will be searchable also. What do you have already tried? We need some code to think on. – Max Yudin Mar 2 '13 at 20:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.