From ad032f4c7c63a972be8d838d8cc58b5b75f67c80 Mon Sep 17 00:00:00 2001 From: Padmassun Rajakareyar Date: Fri, 1 Jun 2018 10:11:20 -0400 Subject: [PATCH] Added file size to HTML response header - BTAP Results --- server/app/controllers/analyses_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/app/controllers/analyses_controller.rb b/server/app/controllers/analyses_controller.rb index 2bb12bae5..e9f442a64 100644 --- a/server/app/controllers/analyses_controller.rb +++ b/server/app/controllers/analyses_controller.rb @@ -727,6 +727,8 @@ def download_BTAP_results_zip path = "/mnt/openstudio/server/assets/results.#{@analysis.id}.zip"; if File.exist?(path) + file_size = File.size(path) + response.headers['Content-Length'] = file_size.to_s send_data File.open(path, 'rb').read, filename: "results.#{@analysis.id}.zip", type: "application/zip", disposition: 'attachment' end end