From 4aeac1bd649c0f0412453c7498f9de7153e6a5cf Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Thu, 18 Jun 2015 21:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=97=B6=EF=BC=8C=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=AC=A1=E6=95=B0=E4=B8=8D=E7=B4=AF=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 4ecff7a40..09ca29178 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -68,6 +68,7 @@ class AttachmentsController < ApplicationController end def direct_download + @attachment.increment_download send_file @attachment.diskfile, :filename => filename_for_content_disposition(@attachment.filename), :type => detect_content_type(@attachment), :disposition => 'attachment' #inline can open in browser @@ -78,7 +79,6 @@ class AttachmentsController < ApplicationController # 下载添加权限设置 candown = attachment_candown @attachment if candown || User.current.admin? || User.current.id == @attachment.author_id - @attachment.increment_download if stale?(:etag => @attachment.digest) if params[:preview] == 'true' convered_file = @attachment.diskfile