# Download mp3's

**URL:** <https://forum.kirupa.com/t/download-mp3s/18697>\
**Category:** Uncategorized\
**Created:** [April 19, 2003, 9:47pm UTC](https://forum.kirupa.com/t/download-mp3s/18697 "2003-04-19T21:47:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![apostrophe](https://avatars.discourse-cdn.com/v4/letter/a/e8c25b/32.png) [@apostrophe](https://forum.kirupa.com/u/apostrophe)\
**Post date:** [April 19, 2003, 9:47pm UTC](https://forum.kirupa.com/t/download-mp3s/18697/1 "2003-04-19T21:47:01Z")

</div>

when clicking on a link for an mp3 ([www.mywebsite.com/song.mp3](http://www.mywebsite.com/song.mp3)) on my website, the mp3 plays in my I.E. explorer window because it is set as my default. I assume that most visitors to the site will have a pre-set application to run mp3’s. Is there a way to force the mp3 to actually download instead of running the 3rd party application? I want the pop-up box to appear on all users allowing them the option of saving it to their harddrive. I can achieve this by .rar or .zip, but I would prefer not to go this route.

Any suggestions?

Thanks,

'pos

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 9:50pm UTC](https://forum.kirupa.com/t/download-mp3s/18697/2 "2003-04-19T21:50:21Z")

</div>

nope…

any wierd extension will prompt to save, etc. tho… just put a note to change extension after download…

example: MyMp3.dgo

Rev ![](http://www.aulman.com/rev.gif)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 19, 2003, 10:21pm UTC](https://forum.kirupa.com/t/download-mp3s/18697/3 "2003-04-19T22:21:59Z")

</div>

i know you can force a download with server side scripting (ie. php). but i’m not sure how to do that. :-\

you should run a search at [google.com](http://google.com). 😉

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [April 20, 2003, 6:47am UTC](https://forum.kirupa.com/t/download-mp3s/18697/4 "2003-04-20T06:47:50Z")

</div>

General idea is something like this (which is just a quick copy/paste from a script i use to push back a server generated pdf…)

```php
 <?
 header("Content-Type: application/octet-stream; name=".$HTTP_POST_VARS["filename"]);
 header("Content-length: " . strlen($HTTP_POST_VARS["pdfdata"]));
 header("Content-Transfer-Encoding: binary");
 header("Accept-Ranges: none");
 header("Content-Disposition: attachment; filename=".$HTTP_POST_VARS["filename"]."
");
 echo $HTTP_POST_VARS["pdfdata"];
 ?>

```
