Freebsd – Wrong MIME-type while uploading files

apache-2.2freebsdmime

I have a problem with MIME-type while uploading a file to server from the web-interface. I used CI as engine for my website. I have FreeBSD with Apache 2.2.15 on the board.
The problem is:

  1. While i upload doc-file, i get application/x-msword, pptapplication/vnd.ms-powerpoint, xlsapplication/vnd.ms-excel – this is normal.
  2. But when i try to upload docx, pptx, xlsx i get application/octet-stream; rarapplication/force-download – and this is wrong.

UPD1. In my mime.types file these MIME-types are present with required type (ie. application/openxmlformats-officedocument.wordprocessingml.document)
UPD2. I wrote "AddType app…/openxml… .docx" in httpd.conf directly and restart apache, but nothing happened.
UPD3. Upload form has enctype "multipart/form-mixed"
UPD4. Content-type in Firebug`s NET-panel have a wrong MIME-type also

Best Answer

This is because .docx files are actually ZIP files with a different extension. If you open one of them up in WinRAR or WinZIP you'll find dozens of .xml files inside them. My guess is that FreeBSD is not aware of the difference between a .docx and a .zip file, because they're the same thing.

That said, I'm really not sure what you're asking or what you're trying to achieve.