Dave's Brain

Browse - Computer Tips - How does Apache set the ContentType for files it sends?

Date: 2018apr2
Product: Apache

Q.  How does Apache set the ContentType for files it sends?

A.  There is a line in conf.http:

TypesConfig /etc/mime.types
Which sends Apache to /etc/mine.types to find get ContentType based on file extension. eg:
text/plain txt
So a .txt file gets:
ContentType: text/plain
In the http header.

Add a comment

Sign in to add a comment
Copyright © 2008-2018, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.