I am using SVN Server 1.8 and Apache2.2. When I add an Exel 2007 file to a repository, SVN automatically adds svn:mime-type property to "application/octet-stream" to the file. When a client use Internet Explore (IE) 8 to access the file, Apache delivers it as "application/octet-stream" and IE 8 sees it as a .zip file.

I tried to modify httpd.conf to add the type to it as follow: AddType application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx

But Apache still delivers the file as "application/octet-stream".

Is there any thing else that I need to set so that Apache can deliver the file with the correct Content-type of "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?

Thank you


Check whether you have this and other vnd.openxmlformats correctly inserted in /etc/mime.types

application/vnd.openxmlformats-officedocument.presentationml.presentation   pptx
application/vnd.openxmlformats-officedocument.presentationml.slide          sldx
application/vnd.openxmlformats-officedocument.presentationml.slideshow      ppsx
application/vnd.openxmlformats-officedocument.presentationml.template       potx
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet           xlsx
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet           xlsx
application/vnd.openxmlformats-officedocument.spreadsheetml.template        xltx
application/vnd.openxmlformats-officedocument.spreadsheetml.template        xltx
application/vnd.openxmlformats-officedocument.wordprocessingml.document     docx
application/vnd.openxmlformats-officedocument.wordprocessingml.template     dotx

Remember to restart Apache after any modifications to mime.types.

Subversion itself examines the file in order to determine if it is a binary file with it's own (and rather clumsy) heuristic based on zeros and non-ASCII characters in the first 1024 bytes of the file.

You can tell Subversion to find mime type mappings from a file with runtime configuration parameter mime-types-file. On Windows machines the runtime configuration file might be found under %APPDATA%\Subversion. On some installation settings might be in Windows registry, search for something like:

  • Yes, i have them in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\conf\mime.types (I am running Windows Server 2008) and I restarted Apache every time I modify it. – David Mar 5 '15 at 4:16
  • When an excel file is added to a repository, SVN automatically attachs svn:mime-type property to it with a value of "application/octet-stream". If I manually remove this property then Apache delivers the file with the correct Content-type as specified in .../mime.types. – David Mar 5 '15 at 17:31
  • It appears that Apaches will takes the MIME type specified in SVN property first, if that does not exist then it look for it in .../mime.types. Is there a way to change that? If that is not possible, can we prevent SVN from automatically adding svn:mime-type property to an excel file when it is added to a repository? – David Mar 5 '15 at 17:31
  • I just updated my answer accordingly. See whether it helps. – Esa Jokinen Mar 6 '15 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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