Restore PDF opening function
This commit is contained in:
parent
efc18045d8
commit
db0ea6c621
|
|
@ -655,8 +655,9 @@ class AnnouncementsController < ApplicationController
|
||||||
@filename = @path.split("/").last
|
@filename = @path.split("/").last
|
||||||
@ext = @path.split("/").last.to_s.split(".").last
|
@ext = @path.split("/").last.to_s.split(".").last
|
||||||
# if @ext == "png" || @ext == "jpg" || @ext == "bmp" || @ext == "pdf"
|
# if @ext == "png" || @ext == "jpg" || @ext == "bmp" || @ext == "pdf"
|
||||||
# render "archives/download_file.html",:layout=>false
|
if @ext == "pdf"
|
||||||
# else
|
render "archives/download_file.html",:layout=>false
|
||||||
|
else
|
||||||
if (current_site.accessibility_mode rescue false)
|
if (current_site.accessibility_mode rescue false)
|
||||||
render "archives/redirect_to_file.html",:layout=>false
|
render "archives/redirect_to_file.html",:layout=>false
|
||||||
return
|
return
|
||||||
|
|
@ -666,7 +667,7 @@ class AnnouncementsController < ApplicationController
|
||||||
send_file(@path, :type=>"application/octet-stream", :filename => @escaped_file_name, :x_sendfile=> true)
|
send_file(@path, :type=>"application/octet-stream", :filename => @escaped_file_name, :x_sendfile=> true)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
# end
|
end
|
||||||
else
|
else
|
||||||
render :file => "#{Rails.root}/app/views/errors/403.html", :layout => false, :status => :not_found, :content_type => 'text/html'
|
render :file => "#{Rails.root}/app/views/errors/403.html", :layout => false, :status => :not_found, :content_type => 'text/html'
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue