zip下载必须得登录

dev_repository_hjq
guange 10 years ago
parent c9b46e4e3a
commit 437d4e1009

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

Loading…
Cancel
Save