title: Ruby-Rails serve ftp file direct to client
body: <p>I am new to ruby and to rails, so excuse my question... .
  What i want to know is, how to take a file from a ftp server with ruby without saving the file on my rails application harddrive (streaming the filedata direct to the client). I am working with the ruby Net/FTP class.</p>
  
  <p>With the method "retrbinary" from the Net/FTP class i have the following snippet:</p>
  
  <pre><code>ftp.retrbinary('RETR ' + filename, 4096) { |data|
    buf &lt;&lt; data
  }
  </code></pre>
  
  <p>In my rails view i can do something like this:</p>
  
  <p><code>send_data( buf )</code></p>
  
  <p>So how do i combine these two. I dont know how to instanziate a buffer object, fill in the stream and than serve it to the user. Has anybody an idea how to do this?</p>