1

not sure how this is done, but following how's its done in Sinatra wouldn't cut it on Goliath - How can I send binary data from Sinatra?

Community
  • 1
  • 1
David
  • 4,235
  • 12
  • 44
  • 52

1 Answers1

1

You can set the 'Content-Type' header into the headers hash and then just send the data back, if your file is small enough.

[200, {'Content-Type' => 'application/octet-stream'}, "\x01\x02\x03"] 

If the file is large, you can do chunked streaming of the response, take a look in the examples directory of Goliath to see a couple of streaming samples.

dj2
  • 9,534
  • 4
  • 29
  • 52