1

In Rails 3.0 it was possible to stream big files, like CSV or XML, with the self.response_body hack.

Rails 3.1 killed this feature and added streaming. Only that streaming doesn't seem to work, or there isn't documentation on how to send large files. I tried with partials, without partials, with html.erb view instead of csv.erb, and nothing works.

How can you stream large files in rails 3.1?

MB.
  • 4,167
  • 8
  • 52
  • 79

1 Answers1

0

if you use Apache/Phusion passenger, have you tried using the rack-based x-sendfile ?

EDIT: more info here

m_x
  • 12,357
  • 7
  • 46
  • 60
  • The CSV/XML files are generated by Rails on demand. So they should be streamed as they are generated. – MB. Sep 26 '11 at 15:29
  • don't know if it can help, but i found **[this](http://stackoverflow.com/questions/3669674/streaming-data-from-sinatra-rack-application)** and **[this](https://github.com/aniero/rack-streaming-proxy)**. Still think that rack is the direction to look at. – m_x Sep 26 '11 at 15:56
  • thanks for all the replies. I'm looking for a Rails 3.1 specific solution. 3.1 added streaming, and I was able to this before. – MB. Sep 26 '11 at 18:49