@ -52,7 +52,7 @@ class UsersController < ApplicationController
def attachment_show
file_name = params[:file_name]
path = params[:path]
path = params[:path] || edu_setting('attachment_folder')
send_file "#{path}/#{file_name}", :filename => "#{file_name}",
:type => 'game',
:disposition => 'attachment' #inline can open in browser
@ -15,4 +15,4 @@ json.created_on attachment.created_on
json.content_type attachment.content_type
json.is_pdf attachment.is_pdf?
json.url attachment.is_pdf? ? download_url(attachment,disposition:"inline") : download_url(attachment)
json.play_url absolute_path(local_path(attachment))
json.play_url attachment_show_users_path(file_name: local_path(attachment))