zip下载必须得登录

dev_repository_hjq
guange 10 years ago
parent c9b46e4e3a
commit 437d4e1009

@ -9,10 +9,14 @@ class ZipdownController < ApplicationController
#统一下载功能 #统一下载功能
def download def download
begin if User.current.logged?
send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => params[:filename], :type => detect_content_type(params[:file]) begin
rescue => e send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => params[:filename], :type => detect_content_type(params[:file])
render file: 'public/no_file_found.html' rescue => e
render file: 'public/no_file_found.html'
end
else
render_403
end end
end end

Loading…
Cancel
Save