Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm building a web server distributing variety kind of binary files. (with Ubuntu) They have vary extensions and sometimes has wrong extension. But currently, my Apache server serves unknown files as text. So I have to make my Apache2 serve all files as binary by default regardless of extension or any metadata except some explicit cases. How can I archive this?

share|improve this question
up vote 3 down vote accepted

Try this directive on your site configuration:

DefaultType application/octet-stream

Or this one:

DefaultType None

The default seems to be text/plain:

DefaultType Directive
Description:    MIME content-type that will be sent if the server cannot determine a type in any other way
Syntax: DefaultType MIME-type|none
Default:    DefaultType text/plain
Context:    server config, virtual host, directory, .htaccess

share|improve this answer
This is correct, but I'll add two points: one, don't test with Internet Explorer, which tries to guess content types; use Firefox (or another decent browser). Also, DefaultType None should be the default configuration; check to make sure you aren't overriding this elsewhere. – BMDan May 2 '11 at 4:27
I thought the same but the docs seem to point to text/plain as the default, see edit. – Eduardo Ivanec May 2 '11 at 10:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.