Download MP3 file from a link

[b][red]This message was edited by DroopyA at 2003-10-1 21:4:53[/red][/b][hr]

I have a website with an mp3 file called "Getting Off - Another World.mp3" in the "Downloads" file on my website. I then want to create a link on the downloads.html page that says "Another World" that allows the user to save the mp3 file when they click this link. Although right now, no "Save" pop up window appears when you click on the link and the web page doesn't appear to do anything while the bootom of the window has a downloading image. How do I get the box to appear to allow the user to actually save the file?

This is the html I have now...

Another World

I know this works on other files (such as zip) but not with mp3. How can I change this? To see what I'm talking about you can visit the page (http://gettingoff.8k.com/downloads.html) but I would really appreciate an answer as soon as possible for this is kind of important.

Thank you for your help
-nate

Comments

  • Nate,

    It works on IE the way you want it, the downloading file dialog appears and starts to download.

    : [b][red]This message was edited by DroopyA at 2003-10-1 21:4:53[/red][/b][hr]
    :
    : I have a website with an mp3 file called "Getting Off - Another World.mp3" in the "Downloads" file on my website. I then want to create a link on the downloads.html page that says "Another World" that allows the user to save the mp3 file when they click this link. Although right now, no "Save" pop up window appears when you click on the link and the web page doesn't appear to do anything while the bootom of the window has a downloading image. How do I get the box to appear to allow the user to actually save the file?
    :
    : This is the html I have now...
    :
    : Another World
    :
    : I know this works on other files (such as zip) but not with mp3. How can I change this? To see what I'm talking about you can visit the page (http://gettingoff.8k.com/downloads.html) but I would really appreciate an answer as soon as possible for this is kind of important.
    :
    : Thank you for your help
    : -nate
    :

    [hr][grey]To err is human, but to really foul things up requires a computer. (Farmers Almanac)[/grey] :-)

  • Thanks for the reply but are you sure? I'm using IE version 6.0.2800.1106 and when I click the link, the bottom of my browser shows a picture of a hard drive with a red arrow showing a download but no "Save As" window appears and it looks as if nothing is happening. Before I had the files in a .zip but figured that since this is a song it would probably be better to just have them automatically save as an mp3 on the users machine. When the files where in .zip format everything worked as planned, but once I replaced the files with .mp3 and changed the code accordingly the "Save As" window stopped from appearing. This could be disscouraging to some potential listeners...

    If I right click the link and choose "save target as" everything works like it should, but if you just click the link it appears that nothing is happening.

    It's almost as if my browser is trying to open the file instead of saving the file. Possably trying to stream the mp3 or something? I would prefer it saved for future use and sharing capabilites. Any ideas?

    Thank you again
    -Nate

    [hr]

    : Nate,
    :
    : It works on IE the way you want it, the downloading file dialog appears and starts to download.
    :
    : : [b][red]This message was edited by DroopyA at 2003-10-1 21:4:53[/red][/b][hr]
    : :
    : : I have a website with an mp3 file called "Getting Off - Another World.mp3" in the "Downloads" file on my website. I then want to create a link on the downloads.html page that says "Another World" that allows the user to save the mp3 file when they click this link. Although right now, no "Save" pop up window appears when you click on the link and the web page doesn't appear to do anything while the bootom of the window has a downloading image. How do I get the box to appear to allow the user to actually save the file?
    : :
    : : This is the html I have now...
    : :
    : : Another World
    : :
    : : I know this works on other files (such as zip) but not with mp3. How can I change this? To see what I'm talking about you can visit the page (http://gettingoff.8k.com/downloads.html) but I would really appreciate an answer as soon as possible for this is kind of important.
    : :
    : : Thank you for your help
    : : -nate
    : :
    :
    : [hr][grey]To err is human, but to really foul things up requires a computer. (Farmers Almanac)[/grey] :-)
    :
    :

  • : This is the html I have now...
    :
    : Another World
    :
    Not really helpful with your problem, but you should be using forward slashes there (/ instead of ).

    As for the problem at hand, it can depend on the way the end user has their computer set up and what header the server sends with the MP3 file. What happens when you click the link? Does it launch an MP3 player to let you listen to it? It's possible for different things to happen on different computers, I'd guess.

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • [b][red]This message was edited by DroopyA at 2003-10-2 16:37:1[/red][/b][hr]
    On my machine at home (Win XP) and at work (win2000) the same thing happens. You click the link, and nothing happens. At the bottom of the browser window in the status bar, a tiny icon of a hard drive with a red arrow pointing downwards appears and the word "Downloading" appears next to it. But, no "Save As" window appears thus most of the people will think the site is broken and leave without ever downloading the song. I've seen this on other sites and thought they were just stupid but now I understand that this is an issue with mp3 files. I don't want to seem like I'm plugging the site, but this is the page that I'm haveing trouble with if you want to see what I'm talking about. http://gettingoff.8k.com/downloads.html

    I'm not sure what's going on but I know it's not asking the user to save like it should and that's not going to work for me. :( At first I thought maybe there was a special HTML tag I could use to always save the selected file but since I'm a VB/C++ programmer I know very little about web design/programming. If worse comes to worse, I could always place the files back into a zip folder but I was hopeing to leave them in mp3 format. Any idea how to force the file to save when clicked or why it might not automatically do this?

    Thanks
    -Nate

    [hr]

    : : This is the html I have now...
    : :
    : : Another World
    : :
    : Not really helpful with your problem, but you should be using forward slashes there (/ instead of ).
    :
    : As for the problem at hand, it can depend on the way the end user has their computer set up and what header the server sends with the MP3 file. What happens when you click the link? Does it launch an MP3 player to let you listen to it? It's possible for different things to happen on different computers, I'd guess.
    :
    : Jonathan
    :
    : ###
    : for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    : (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    : /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
    :
    :



  • : On my machine at home (Win XP) and at work (win2000) the same thing
    : happens. You click the link, and nothing happens. At the bottom of
    : the browser window in the status bar, a tiny icon of a hard drive
    : with a red arrow pointing downwards appears and the
    : word "Downloading" appears next to it. But, no "Save As" window
    : appears thus most of the people will think the site is broken and
    : leave without ever downloading the song.
    :
    Amusingly enough, my PC proved my earlier point by showing the save file dialog when I clicked the link!

    There are a copule of things to possibly try. One is a hack that may work, one is almost certain to, but you may have trouble doing it.

    1) Link to a HTML page that does a META Refresh to the file to be downloaded. This sometimes works, but it's a bit of a hack. May as well give it a go...

    2) You can force it by sending a different Content-type: header. If you send:-
    Content-type: application/octet-stream
    Then from what I know that should cause the Save File... dialog to be displayed. If you can use .htacces files on your web host, try creating one with this in it:-

    [code]
    Header unset Content-type
    Header append Content-type "application/octet-stream"
    [/code]

    Don't promise it'll work, but could be worth a try! ;-)

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • Thanks for your help. I guess it is a machine issue. I'll try the ideas you gave me and if those don't work, I'll just place them back in a zip file and tell everybody to just deal with it. Thanks again for your help.

    peace
    -Nate

    [hr]

    : : On my machine at home (Win XP) and at work (win2000) the same thing
    : : happens. You click the link, and nothing happens. At the bottom of
    : : the browser window in the status bar, a tiny icon of a hard drive
    : : with a red arrow pointing downwards appears and the
    : : word "Downloading" appears next to it. But, no "Save As" window
    : : appears thus most of the people will think the site is broken and
    : : leave without ever downloading the song.
    : :
    : Amusingly enough, my PC proved my earlier point by showing the save file dialog when I clicked the link!
    :
    : There are a copule of things to possibly try. One is a hack that may work, one is almost certain to, but you may have trouble doing it.
    :
    : 1) Link to a HTML page that does a META Refresh to the file to be downloaded. This sometimes works, but it's a bit of a hack. May as well give it a go...
    :
    : 2) You can force it by sending a different Content-type: header. If you send:-
    : Content-type: application/octet-stream
    : Then from what I know that should cause the Save File... dialog to be displayed. If you can use .htacces files on your web host, try creating one with this in it:-
    :
    : [code]
    : Header unset Content-type
    : Header append Content-type "application/octet-stream"
    : [/code]
    :
    : Don't promise it'll work, but could be worth a try! ;-)
    :
    : Jonathan
    :
    : ###
    : for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    : (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    : /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
    :
    :

  • Hi,

    I stick to Jonathan's opinion. What is happening in your browser (that is the mp3 is opening immediately instead of offering the dialog) is because you're file has already been accessed and ready on your machine.
    Leave it as it is, in mp3 format. Users accessing your page for the first time will have the save / open dialog first.
    (Assuming they set their broswers in a similar manner :-) as I did)

    : Thanks for your help. I guess it is a machine issue. I'll try the ideas you gave me and if those don't work, I'll just place them back in a zip file and tell everybody to just deal with it. Thanks again for your help.
    :
    : peace
    : -Nate
    :
    : [hr]
    :
    : : : On my machine at home (Win XP) and at work (win2000) the same thing
    : : : happens. You click the link, and nothing happens. At the bottom of
    : : : the browser window in the status bar, a tiny icon of a hard drive
    : : : with a red arrow pointing downwards appears and the
    : : : word "Downloading" appears next to it. But, no "Save As" window
    : : : appears thus most of the people will think the site is broken and
    : : : leave without ever downloading the song.
    : : :
    : : Amusingly enough, my PC proved my earlier point by showing the save file dialog when I clicked the link!
    : :
    : : There are a copule of things to possibly try. One is a hack that may work, one is almost certain to, but you may have trouble doing it.
    : :
    : : 1) Link to a HTML page that does a META Refresh to the file to be downloaded. This sometimes works, but it's a bit of a hack. May as well give it a go...
    : :
    : : 2) You can force it by sending a different Content-type: header. If you send:-
    : : Content-type: application/octet-stream
    : : Then from what I know that should cause the Save File... dialog to be displayed. If you can use .htacces files on your web host, try creating one with this in it:-
    : :
    : : [code]
    : : Header unset Content-type
    : : Header append Content-type "application/octet-stream"
    : : [/code]
    : :
    : : Don't promise it'll work, but could be worth a try! ;-)
    : :
    : : Jonathan
    : :
    : : ###
    : : for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    : : (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    : : /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
    : :
    : :
    :
    :

    [hr][grey]To err is human, but to really foul things up requires a computer. (Farmers Almanac)[/grey] :-)

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories