|
|
@ -43,7 +43,7 @@ class ZipdownController < ApplicationController
|
|
|
|
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 file: 'zipdown/no_file_dowmload.js.erb'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
render_403 :message =>:notice_file_not_found
|
|
|
|
render_403 :message =>:notice_file_not_found
|
|
|
@ -52,7 +52,7 @@ class ZipdownController < ApplicationController
|
|
|
|
render_403 :message => :notice_not_authorized
|
|
|
|
render_403 :message => :notice_not_authorized
|
|
|
|
end
|
|
|
|
end
|
|
|
|
rescue => e
|
|
|
|
rescue => e
|
|
|
|
render file: 'public/file_not_found.html'
|
|
|
|
render file: 'zipdown/file_not_fond.js.erb'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
private
|
|
|
|
private
|
|
|
|