Skip to content

Instantly share code, notes, and snippets.

@Agowan
Created May 6, 2015 12:38
Show Gist options
  • Save Agowan/3d3e5d7dd4c534f2a4ca to your computer and use it in GitHub Desktop.
Save Agowan/3d3e5d7dd4c534f2a4ca to your computer and use it in GitHub Desktop.
Override StringIO content type
# encoding: utf-8
class StringFile < StringIO
def initialize(file_content, file_name, file_type)
super(file_content)
@file_name = file_name
@file_type = file_type
end
def content_type
@file_type
end
def original_filename
@file_name
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment