From ade4ffb7076f521c8b6653a6dd2b1f8d82c22e1b Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 5 Jul 2019 20:52:31 +0800 Subject: [PATCH] fixbug --- app/controllers/homework_commons_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 355a8d8e3..b12980094 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -208,7 +208,7 @@ class HomeworkCommonsController < ApplicationController student_work_to_xlsx(@work_excel,@homework) exercise_export_name = current_user.real_name + "_" + @course.name + "_" + @homework.name + "_" + Time.now.strftime('%Y%m%d_%H%M%S') # response.set_header("Content-Disposition","attachment; filename=#{exercise_export_name.strip.first(30)}};filename*=utf-8''#{exercise_export_name.strip.first(30)}}") - file_name = Base64.encode64(exercise_export_name.strip.first(30)) + file_name = Base64.urlsafe_encode64(exercise_export_name.strip.first(30)) # response.setHeader['Content-Disposition'] = "attachment; filename=\"#{exercise_export_name.strip.first(30)}\"" render xlsx: "#{file_name}",template: "homework_commons/works_list.xlsx.axlsx",locals: {table_columns: @work_head_cells,task_users: @work_cells_column}