Module: Engine2::BlobSupportMeta

Included in:
DownloadBlobStoreMeta, DownloadForeignBlobStoreMeta
Defined in:
lib/engine2/meta/infra_meta.rb

Instance Method Summary collapse

Instance Method Details

#serve_blob(handler, entry, inf) ⇒ Object



101
102
103
104
105
106
# File 'lib/engine2/meta/infra_meta.rb', line 101

def serve_blob handler, entry, inf
    handler.permit entry
    handler.attachment entry[inf[:name_field]]
    handler.content_type (entry[inf[:mime_field]].to_s.empty? ? "application/octet-stream" : entry[inf[:mime_field]])
    entry[inf[:bytes_field]].getBinaryStream().to_io.read
end