|
|
|
@ -9,10 +9,14 @@ class ZipdownController < ApplicationController
|
|
|
|
|
|
|
|
|
|
#统一下载功能
|
|
|
|
|
def download
|
|
|
|
|
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'
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|