yolanda/trunk/uploader.pl
josch 13f42715e7 initial uploading capabilities
git-svn-id: http://yolanda.mister-muffin.de/svn@16 7eef14d0-6ed0-489d-bf55-20463b2d70db
2007-10-10 18:36:12 +00:00

30 lines
701 B
Perl

require "/var/www/perl/include.pl";
require "/var/www/perl/functions.pl";
CGI::Session->name($session_name);
$query = CGI->new(\&hook);
$session = new CGI::Session;
#$query = new CGI;
sub hook {
my ($filename, $buffer, $bytes_read, $data) = @_;
open(TEMP, ">/var/www/perl/temp.temp") or die "cannot open";
print TEMP "Read $bytes_read bytes of $filename\n";
close TEMP;
}
my $username = get_username_from_sid($session->id);
if($username) {
my $filename = $query->param("file");
my $title = $query->param("title");
$upload_filehandle = $query->upload("file");
print $session->header();
while ( <$upload_filehandle> )
{
print;
}
} else {
print $session->header();
print "nope...";
}