0
votes

As you know, chrome is playing an mp3 file using it's own player. But I need to download it to my file system.. I tryed this, but do not have any result:

$('.audio_download').click(function(){
    var s = $(this).attr('value');
    $('body').append('<iframe src='+s+' class="dlframe"></iframe>');
    $('iframe.dlframe').ready(function(){
        $(this).remove();
    });
});

I checked console and I found there this: Resource interpreted as Document but transferred with MIME type audio/mpeg: "some-url.mp3".

2
You might need to send specific headers to the browser from the server end.Ivan

2 Answers

2
votes

Set attribute "download" like

<a href='file.mp3' download='Very-Very-Good.mp3'>download</a>