Sha256: 6e745f699278f6b05b1bbdc217373a1b6c9deb338c369c62681de46134b74313
Contents?: true
Size: 531 Bytes
Versions: 6
Compression:
Stored size: 531 Bytes
Contents
module PostmanMta class AttachmentsController < ApplicationController include ActionController::DataStreaming def show response = attachment.find(params[:uuid]).deep_symbolize_keys file = response.dig(:json, :attachment) file_data = Base64.decode64(file[:body]) send_data(file_data, type: file[:content_type], filename: file[:filename], dispostion: 'attachment') end private def attachment @attachment ||= PostmanMta::Attachment.new(params[:message_token]) end end end
Version data entries
6 entries across 6 versions & 1 rubygems