Ivan Anishchuk
Ivan Anishchuk

Reputation: 485

Force download mp3 links in safari with content-disposition:inline

I need to force download mp3 files from box.com. Unfortunately, Box adds content-disposition:inline header to all responses and there is no way to change this or set custom mimetype for file. So browsers stream file instead of downloading. And I cannot use any server-side solutions to change response headers for traffic reasons (all downloads should be done directly from box.com).

For Chrome/Chromium I can use html5 download attribute for <a>, but safari does not support it (tested with 5.0.4 on mac).

So what can be done for Safari? Maybe there are some JavaScript tricks or something?

Upvotes: 2

Views: 1304

Answers (1)

Alpesh Shah
Alpesh Shah

Reputation: 123

Can you add a line to .htaccess to set the type?

AddType application/octet-stream .mp3

octet-stream will force a download.

Upvotes: 1

Related Questions