Allow binary files to be downloaded

This commit is contained in:
Sebastian Serth
2021-01-11 15:19:37 +01:00
parent 4ea3cb29d3
commit 862e274739

View File

@ -76,7 +76,7 @@ class SubmissionsController < ApplicationController
stringio = Zip::OutputStream.write_buffer do |zio|
@files.each do |file|
zio.put_next_entry(file.path.to_s == '' ? file.name_with_extension : File.join(file.path, file.name_with_extension))
zio.write(file.content)
zio.write(file.content.present? ? file.content : file.native_file.read)
end
# zip exercise description