|
|
@ -41,7 +41,7 @@ class ZipdownController < ApplicationController
|
|
|
|
if homework != nil
|
|
|
|
if homework != nil
|
|
|
|
if homework.attachments.count > 0
|
|
|
|
if homework.attachments.count > 0
|
|
|
|
zipfile = zip_homework_by_user homework
|
|
|
|
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
|
|
|
|
else
|
|
|
|
render_403 :message => :no_file_dowmload
|
|
|
|
render_403 :message => :no_file_dowmload
|
|
|
|
end
|
|
|
|
end
|
|
|
@ -51,6 +51,8 @@ class ZipdownController < ApplicationController
|
|
|
|
else
|
|
|
|
else
|
|
|
|
render_403 :message => :notice_not_authorized
|
|
|
|
render_403 :message => :notice_not_authorized
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
rescue => e
|
|
|
|
|
|
|
|
render file: 'public/file_not_found.html'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
private
|
|
|
|