|
|
@ -9,11 +9,15 @@ class ZipdownController < ApplicationController
|
|
|
|
|
|
|
|
|
|
|
|
#统一下载功能
|
|
|
|
#统一下载功能
|
|
|
|
def download
|
|
|
|
def download
|
|
|
|
|
|
|
|
if User.current.logged?
|
|
|
|
begin
|
|
|
|
begin
|
|
|
|
send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => params[:filename], :type => detect_content_type(params[:file])
|
|
|
|
send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => params[:filename], :type => detect_content_type(params[:file])
|
|
|
|
rescue => e
|
|
|
|
rescue => e
|
|
|
|
render file: 'public/no_file_found.html'
|
|
|
|
render file: 'public/no_file_found.html'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
render_403
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
#一个作业下所有文件打包下载,只有admin和课程老师有权限
|
|
|
|
#一个作业下所有文件打包下载,只有admin和课程老师有权限
|
|
|
|