diff --git a/app/models/card/exportable.rb b/app/models/card/exportable.rb index ffff82581..b147c47d9 100644 --- a/app/models/card/exportable.rb +++ b/app/models/card/exportable.rb @@ -67,7 +67,7 @@ module Card::Exportable end def collect_attachments - attachments.to_a + comments.flat_map { |c| c.attachments.to_a } + (attachments.to_a + comments.flat_map { |c| c.attachments.to_a }).uniq(&:blob_id) end def export_status diff --git a/app/models/zip_file.rb b/app/models/zip_file.rb index d6fb0ad0a..f0ecf8dea 100644 --- a/app/models/zip_file.rb +++ b/app/models/zip_file.rb @@ -44,7 +44,12 @@ class ZipFile # ActiveStorage's upload method expects a read-based IO, but ZipKit # needs a write-based stream. The TransferManager's upload_stream # yields a writable IO that we can stream directly to. - service.send(:upload_stream, key: blob.key, part_size: 100.megabytes) do |write_stream| + service.send(:upload_stream, + key: blob.key, + content_type: "application/zip", + part_size: 100.megabytes, + **service.upload_options + ) do |write_stream| write_stream.binmode writer.stream_to(write_stream) yield writer