From 82c2a659df3889fae196a2e96d5153932fb35f7f Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 9 Jan 2015 15:33:30 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=89=93=E5=8C=85=E4=B8=8B=E8=BD=BD=E6=97=B6=EF=BC=8C=E6=9F=90?= =?UTF-8?q?=E4=B8=80=E6=96=87=E4=BB=B6=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=B7=B3=E8=BF=87=E8=AF=A5=E6=96=87=E4=BB=B6=E7=BB=A7?= =?UTF-8?q?=E7=BB=AD=E4=B8=8B=E8=BD=BD=E5=85=B6=E4=BB=96=E7=9A=84=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 3612bf7a4..982e43b7b 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -78,7 +78,7 @@ class ZipdownController < ApplicationController # 需要将所有homework.attachments遍历加入zip # 并且返回zip路径 homeattach.attachments.each do |attach| - homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1) + homeworks_attach_path << attach.diskfile if File.exist?(attach.diskfile) end zipping("#{homeattach.user.lastname}#{homeattach.user.firstname}_#{((homeattach.user.user_extensions.nil? || homeattach.user.user_extensions.student_id.nil?) ? "" : homeattach.user.user_extensions.student_id)}_#{Time.now.to_i.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true) end