|
|
|
@ -27,7 +27,7 @@ class ZipdownController < ApplicationController
|
|
|
|
|
else
|
|
|
|
|
logger.error "[ZipDown#assort] ===> #{obj.class.to_s.to_sym} unKown !!"
|
|
|
|
|
end
|
|
|
|
|
send_file zipfile, :filename => obj.name, :type => detect_content_type(zipfile) if zipfile
|
|
|
|
|
send_file zipfile, :filename => obj.name+".zip", :type => detect_content_type(zipfile) if zipfile
|
|
|
|
|
|
|
|
|
|
#rescue NameError, ActiveRecord::RecordNotFound => e
|
|
|
|
|
#logger.error "[ZipDown] ===> #{e}"
|
|
|
|
@ -39,7 +39,7 @@ class ZipdownController < ApplicationController
|
|
|
|
|
homework = HomeworkAttach.find params[:homework]
|
|
|
|
|
if homework != nil && (User.current.admin? || User.current.member_of?(homework.bid.courses.first))
|
|
|
|
|
zipfile = zip_homework_by_user homework
|
|
|
|
|
send_file zipfile, :filename => homework.name, :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 => :notice_not_authorized
|
|
|
|
|
end
|
|
|
|
@ -88,7 +88,7 @@ class ZipdownController < ApplicationController
|
|
|
|
|
#length = attach.storage_path.length
|
|
|
|
|
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
|
|
|
|
|
end
|
|
|
|
|
zipping "#{homeattach.user.name.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true
|
|
|
|
|
zipping "#{homeattach.user.name.to_s}_#{Time.now.to_i}.zip", homeworks_attach_path, OUTPUT_FOLDER, true
|
|
|
|
|
#user_attaches_paths
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|