Name: Roger 2007-06-14 22:45 ID:GTmqL9WA
I need a script in where I can upload a flash and it generates a page with it.
#!/usr/bin/perl
use strict;
use CGI;
use MIME::Base64 qw(encode_base64);
my $query=new CGI;
my $file=$query->param('file');
print "Content-type: text/html;\n\n",'<html><body><form method="post" action="',$ENV{SCRIPT_NAME},'"><input type="file" name="file"><input type="submit"></form>';
if($file){
binmode $file;
local($/) = undef;
print '<object type="application/x-shockwave-flash" data="data:application/x-shockwave-flash;base64,',encode_base64($file),'"></object>';
}
print "</body></html>\n";