in reply to Using perl to stream flash
Assuming this is about stealing bandwidth (no way to stop people from saving your flash to their computers), and you're not into the Apache options posted above, this would be a way to serve up a file using CGI:
(add error-checking!)use strict; use warnings; use CGI; my $flash_file = 'your_flash_file.swf'; open FLASH, '<', $flash_file or die $!; binmode FLASH; my $q = new CGI; print $q->header( -content-type => 'flash/swf' -content_Length => (stat FLASH)[7] ); my $buffer; while (read(FLASH, $buffer, 1024) > 0){ print $buffer; } close FLASH;
You may need to do some research on the HTTP headers to send along with the data. I am just guessing at the Content-type, for instance.
Hope this helps.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using perl to stream flash
by Feltros (Acolyte) on Sep 25, 2006 at 00:44 UTC | |
by Feltros (Acolyte) on Sep 25, 2006 at 01:04 UTC | |
by crashtest (Curate) on Sep 26, 2006 at 04:36 UTC |