I have a file (*.lwxl) that I would like for users to download a file, but the mime-type is text/html, and I would like to change it to application. Is there any way to do this?
5 Answers
If you have access to your Apache configuration (if you don't want to write a PHP script that will send the headers and the file content), maybe the AddType directive can help you :
The
AddTypedirective maps the given filename extensions onto the specified content type. MIME-type is the MIME type to use for filenames containing extension. [...] This directive can be used to add mappings not listed in the MIME types file
The given example looks like this :
AddType image/gif .gif
Comments
You will need to set the mime type using a scripting language. Here is how to do it in PHP.
1 Comment
You can't do that from PHP - you should do it through your Apache (or IIS or...) config.
For Apache you can edit your mime.types file:
application/lwxl-type lwxl