views:

56

answers:

2

I am running a subversion server with access via http using webdav. I have noticed that when I access the repository with a browser, sometimes the pdf files in the repository show up as plain text (as if you viewed the pdf with a text editor like emacs, vim, or notepad) instead of being downloaded, or opened with some pdf reader. If you save the page, then open it with a pdf reader, it works fine. Any ideas why this might be happening? It seems to be somewhat browser dependent, and doesn't happen with all files. The file below seems to have this problem a lot though: http://robfelty.com/subversion/ling5200/slides/ling5200-all-notes.pdf

+1  A: 

Maybe the file has the wrong mime type? It should be something like "application/octet-stream".

sbi
+3  A: 

Set the svn property svn:mime-type to application/octed-stream, or better yet to application/pdf.

Stefan
Thanks a bunch. That did the trick. Why doesn't apache do this automatically for subversion webdav stuff like it does for files in the normal file system?
Robert Felty
It's the svn_mod_dav apache module that's responsible for this. And that module only uses the svn:mime-type properties and doesn't use the extension/mimetype config file.
Stefan