5
6
7
8
9
10
11
12
13
|
# File 'app/controllers/downloads_controller.rb', line 5
def show
@download = Download.find(params[:id])
raise ReaderError::AccessDenied, t("downloads_extension.permission_denied") unless @download.visible_to?(current_reader)
response.['X-Accel-Redirect'] = @download.document.url
response.["Content-Type"] = @download.document_content_type
response.['Content-Disposition'] = "attachment; filename=#{@download.document_file_name}"
response.['Content-Length'] = @download.document_file_size
render :nothing => true
end
|