diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index 57492c1..b1a4e59 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -195,7 +195,7 @@ class ArchivesController < ApplicationController @path = file.file.file.file rescue "" @filename = @path.split("/").last @ext = @path.split("/").last.to_s.split(".").last - if @ext == "png" || @ext == "jpg" || @ext == "bmp" + if @ext == "png" || @ext == "jpg" || @ext == "bmp" || @ext == "pdf" render "download_file",:layout=>false else send_file(@path) diff --git a/app/views/archives/download_file.html.erb b/app/views/archives/download_file.html.erb index 1bbee7f..0232f77 100644 --- a/app/views/archives/download_file.html.erb +++ b/app/views/archives/download_file.html.erb @@ -1,4 +1,4 @@ - + <%=@filename%> @@ -6,6 +6,13 @@

<%=@filename%>

- <%=@filename%> + <% if @ext != "png" && @ext != "jpg" && @ext != "bmp" %> + + + + + <% else %> + <%=@filename%> + <% end %> -> \ No newline at end of file + \ No newline at end of file