Allow PDF downloading.

This commit is contained in:
Kolan Sh 2012-07-12 16:46:04 +04:00 committed by Kolan Sh
parent be1412e183
commit 709c59547e
2 changed files with 4 additions and 1 deletions

2
README
View File

@ -2,6 +2,6 @@ Fork of Embedded plugin (http://www.redmine.org/wiki/redmine/PluginEmbedded).
Correct style and search for all Doxygen versions.
Setup:
Index files: index.html
Valid extensions: html png gif js css
Valid extensions: html png gif js css pdf
Default template: doxygen.
Menu caption: Doxygen

View File

@ -56,6 +56,9 @@ class RedmineEmbeddedController < ApplicationController
elsif path.match('\.js$')
raw=File.read(path)
send_data raw, :disposition => 'inline', :type => "text/javascript", :streaming => "true"
elsif path.match('\.pdf$')
raw=File.read(path)
send_data raw, :disposition => 'inline', :type => "application/pdf", :streaming => "true"
else
embed_file path
end