|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
class ZipdownController < ApplicationController
|
|
|
|
|
|
|
|
|
|
#查找项目(课程)
|
|
|
|
|
before_filter :find_project_by_bid_id, :only => [:assort]
|
|
|
|
|
#检查权限
|
|
|
|
@ -43,14 +44,15 @@ class ZipdownController < ApplicationController
|
|
|
|
|
zipfile = zip_homework_by_user homework
|
|
|
|
|
send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile)
|
|
|
|
|
else
|
|
|
|
|
render_403 :message => :no_file_dowmload
|
|
|
|
|
render_403 :message => :no_file_dowmload ,:layout => "course_base"
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
render_403 :message =>:notice_file_not_found
|
|
|
|
|
render_403 :message =>:notice_file_not_found ,:layout => "course_base"
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
render_403 :message => :notice_not_authorized
|
|
|
|
|
render_403 :message => :notice_not_authorized ,:layout => "course_base"
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
rescue => e
|
|
|
|
|
render file: 'public/file_not_found.html'
|
|
|
|
|
end
|
|
|
|
|