Stringio original_filename

data = StringIO.new(file_data)
data.class.class_eval { attr_accessor :original_filename, :content_type }

data.content_type = content_type
data.original_filename = file_name

object.attachment = data
patrick204nqh