yolanda/trunk/uploader
erlehmann 3016c3a294 no file extensions for sane URLs
git-svn-id: http://yolanda.mister-muffin.de/svn@18 7eef14d0-6ed0-489d-bf55-20463b2d70db
2007-10-10 21:32:46 +00:00

30 lines
701 B
Text

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...";
}