Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ensure mime-type is set correctly in Subversion when missing as a property?

We have currently the problem that a lot of files stored in Subversion are missing the mime-type. Depending on the browser you are using, when surfing a Subversion directory and clicking on a link, you see the text e.g. of a PDF and not the PDF rendered in Acrobat Reader.

The obvious solution to this is to set the property in Subversion, in this example to set svn:mime-type to application/pdf and to set the relevant section in auto-props in the Subversion client configuration file. But a lot of our users don't understand that, and we don't control all their settings, so there will be added over and over again files to the repositories where the correct mime-type will be missing.

What are the options to correct this, and what are the drawbacks in using them?

like image 674
mliebelt Avatar asked Jan 23 '26 06:01

mliebelt


1 Answers

If you use Apache HTTP Server to serve your Subversion repositories then you should configure default media types with help of mod_mime module. See docs at Apache Module mod_mime.

Generally speaking you need to add the following strings to Apache config and point TypesConfig to your mime.types file.

LoadModule mime_module bin/mod_mime.so
TypesConfig <path-to-mime.types-file>
like image 54
bahrep Avatar answered Jan 25 '26 00:01

bahrep