Creating an IO ruby ​​object from


I'm using sinatra and transloadit and sending files with xhr using valumns file uploader.

I need to create a IO object and fill it with data in

How can I do that ? thank you.

Use StringIO:

require 'stringio'

Alternatively, can't you just pass request.body for your IO object?