WebFaction
Community site: login faq

Until relatively recently, I was able to upload mp3s to my static/PHP web space and accessing the URL in the browser would produce a download prompt in all the browsers I tried.

Now, when I access an mp3, it starts streaming - in the browser itself in Firefox and Chrome, and via Media Player when using Internet Explorer. This is a problem because I need the files to be downloadable but the end user gets no control over this.

Did someone change the mime type for MP3s on the web server? Or perhaps the static web server itself changed during a migration or something? And can I configure it differently somehow?

asked 18 Jun '13, 06:24

Kylotan
15149
accept rate: 0%


We've not changed anything recently regarding mime types and MP3.

I think to force a download, MP3 needs to be served as application/octet-stream, so try adding this to .htaccess in your MP3 directory:

AddType application/octet-stream .mp3

You might also try ForceType or DefaultType if you have directories that contain nothing except mp3 files. Both of those are documented in the Apache Core Features doc.

Hope that helps!

permanent link

answered 18 Jun '13, 20:27

seanf
12.2k31836
accept rate: 37%

Something certainly has changed, although I couldn't tell you how recently it happened. Could have been in recent months rather than weeks. (I suppose it could also just be that several browsers all changed the way they handle the type at similar times, but that seems unlikely.)

Anyway, I added the line in .htaccess and now it seems to work on Chrome, with Firefox seemingly randomly deciding whether to download or stream individual mp3 files (all with the same extension, in the same directory). Annoying.

(20 Jun '13, 06:03) Kylotan

Feel free to open a support ticket so that we can take a closer look.

(20 Jun '13, 19:07) seanf
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×124
×5
×3

question asked: 18 Jun '13, 06:24

question was seen: 2,156 times

last updated: 20 Jun '13, 19:07

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM