From de17a84061dca4d765d1b0dfb6a6d64faf3e1819 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 22 Jul 2014 13:48:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BC=82=E5=B8=B8=E6=8D=95?= =?UTF-8?q?=E8=8E=B7=EF=BC=8C=E5=BD=93=E4=BD=9C=E4=B8=9A=E6=9C=AA=E6=89=BE?= =?UTF-8?q?=E5=88=B0=E7=9B=B8=E5=BA=94=E6=96=87=E4=BB=B6=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E8=B7=B3=E5=88=B0=E6=96=87=E4=BB=B6=E6=9C=AA=E6=89=BE=E5=88=B0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2(=E4=B8=8D=E6=8A=A5500=E9=94=99=E8=AF=AF)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 653400cbe..16e6ea870 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -41,7 +41,7 @@ class ZipdownController < ApplicationController if homework != nil if homework.attachments.count > 0 zipfile = zip_homework_by_user homework - send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if zipfile + send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile) else render_403 :message => :no_file_dowmload end @@ -51,6 +51,8 @@ class ZipdownController < ApplicationController else render_403 :message => :notice_not_authorized end + rescue => e + render file: 'public/file_not_found.html' end private