diff --git a/app/services/export_shixun_report_service.rb b/app/services/export_shixun_report_service.rb index 2339b6d56..b75f031c0 100644 --- a/app/services/export_shixun_report_service.rb +++ b/app/services/export_shixun_report_service.rb @@ -33,8 +33,8 @@ class ExportShixunReportService base_css = %w(app/templates/shared/main.css app/templates/shixun_work/shixun_work.css app/templates/shared/codemirror.css) base_css.each { |css| kit.stylesheets << Rails.root.join(css) } - file_name = "#{Rails.root}/files/archiveZip/#{filename}" - kit.to_pdf(file_name) + file = Tempfile.new(filename) + kit.to_pdf(file.path) file end