Skip to content

Commit

Permalink
Added file size to HTML response header - BTAP Results
Browse files Browse the repository at this point in the history
  • Loading branch information
padmassun authored Jun 1, 2018
1 parent 24fd925 commit ad032f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/app/controllers/analyses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad032f4

Please sign in to comment.