开发者

How can I alter the default behavior of a link to an mp3 file?

I'd like to alter the default behavior of a link that points to an mp3 file. All major browsers always open and play this mp3 file in a new window, and I'd like instead that this file be offered as a download by the browser.

¿Any 开发者_开发技巧Idea?

Thanks!!


If you control the server hosting the mp3, try serving it as Content-Type: application/octet-stream. and Content-disposition: attachment.


If you don't have enough control to set the content header, you could provide instructions that say to "Right click and Save As...", I've seen a lot of web sites do this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜