# Fast passing data through to the browser (swf)

**URL:** <https://www.ruby-forum.com/t/fast-passing-data-through-to-the-browser-swf/74555>\
**Category:** Ruby\
**Created:** [November 7, 2006, 10:48am UTC](https://www.ruby-forum.com/t/fast-passing-data-through-to-the-browser-swf/74555 "2006-11-07T10:48:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 7, 2006, 10:48am UTC](https://www.ruby-forum.com/t/fast-passing-data-through-to-the-browser-swf/74555/1 "2006-11-07T10:48:04Z")

</div>

hi -

I need to pass a user a chunk of swf (flash) data: ie a full-flash page.  
without using a redirect, is there a quick way to read a file and send  
as a chunk of binary data back to the browser? PHP had some type of  
“pass-through” function.

otherwise i guess i have file open, read as a string, and then use …  
? to write as a buffered output to the browser?

tx,

## /dc

```
  David "DC" Collier

```

[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
+81 (0)80 6521 9559  
skype: callto://d3ntaku

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 7, 2006, 10:48am UTC](https://www.ruby-forum.com/t/fast-passing-data-through-to-the-browser-swf/74555/2 "2006-11-07T10:48:27Z")

</div>

Hello David,

On Tue, 31 Oct 2006 12:34:56 +0900, dc [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I need to pass a user a chunk of swf (flash) data: ie a full-flash page.  
> without using a redirect, is there a quick way to read a file and send  
> as a chunk of binary data back to the browser? PHP had some type of  
> “pass-through” function.
> 
> otherwise i guess i have file open, read as a string, and then use …  
> ? to write as a buffered output to the browser?

There are a few solutions, but it depends upon your environment.  
Are you using plain Rails, Ruby CGI, mod\_ruby, Apache, Lighttpd?

Here are few links that might help:

[http://wiki.rubyonrails.org/rails/pages/HowtoSendFilesFast](http://wiki.rubyonrails.org/rails/pages/HowtoSendFilesFast)

> **[X-Sendfile - lighty's life](http://blog.lighttpd.net/articles/2006/07/02/x-sendfile/)**
>
> ... or the hidden secrets of lighty. X-Sendfile is one of the important, but mostly unknown features. Time to put the spot-light on it and see why …

[http://blog.segment7.net/articles/2006/03/27/image-serving-with-webrick](http://blog.segment7.net/articles/2006/03/27/image-serving-with-webrick)

[http://rubyonrails.org/api/classes/ActionController/Streaming.html](http://rubyonrails.org/api/classes/ActionController/Streaming.html)

Best,  
Zev
