mp3下载响应的内容类型 [英] content type for mp3 download response
问题描述
我创建了一个简单的HTTP服务器,允许用户下载文件。但这似乎不适用于mp3文件。内容类型目前是application / misc
。为了使它与mp3文件一起使用,我试过application / mp3
,application / data
和application / mpeg
。
I have created a simple HTTP server which allows users to download files. But this does not seem to work for mp3 files. The content type currently is "application/misc"
. In order to make it work with mp3 files , I've tried "application/mp3"
, "application/data"
and "application/mpeg"
.
什么是适合mp3或音频文件下载的内容类型,我错过了其他一些标题吗?
What would be the right content type for mp3 or audio file download, and am I missing some other headers?
编辑:文件应自动开始下载而不是提示用户保存某处。
The file should automatically start downloading rather than prompting the user for saving it somewhere.
推荐答案
尝试Content-Type:audio / mpeg
更新
为了鼓励浏览器下载mp3而不是流媒体,做
To encourage the browser to download the mp3 rather then streaming, do
Content-Disposition:filename =music.mp3'
Content-Disposition: filename="music.mp3"'
这篇关于mp3下载响应的内容类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!