Reputation: 3
I'll admit, I am new to using SVN but I'm slowly learning.
I recently setup SVN to be accessible through my Apache web server. I love being able to open a web browser, authenticate, and then see my code.
The only issue that I am having is that PDFs and images are downloaded rather than viewed in the web browser upon being clicked.
I figure that if my browser shows me Perl scripts and other languages natively, it should be able to display PDFs and images that are within my SVN directory.
Do I need to change some setting with Apache or SVN?
Upvotes: 0
Views: 578
Reputation: 30662
VisualSVN Server supports viewing several document formats right in the web interface without having to download files. Check the demo at https://demo-server.visualsvn.com/!/#documents.
Besides code, text and images, the following formats are supported:
Apache HTTP Server itself can be instructed to make use of MIME-types. It must have mod_mime
enabled with proper configuration. I guess that your server has this already enabled. However, there can be caveats when PDF will open in browser window of Internet Explorer while in Firefox it will be downloaded. So the behavior may depend on the web browser you use.
As @Álvaro suggested, you can use svn:mime-type
SVN property. It can also affect the way how the file behaves when opened via a web browser. If the property is set, Apache will use its value to populate the Content-type:
HTTP header when responding to GET requests (even instead of the one specified in mime-types). It tells the web browser how to display a file. See SVNBook | File Content Type section.
Upvotes: 1