3 print "Content-type: text/plain\n\n";
5 if ($ENV{'REQUEST_METHOD'} eq "POST") {
6 if ($ENV{'CONTENT_LENGTH'}) {
7 read(STDIN
, $postData, $ENV{'CONTENT_LENGTH'}) || die "Could not get post data\n";
12 @list = split(/&/, $ENV{'QUERY_STRING'});
13 foreach $element (@list) {
14 ($key, $value) = split(/=/, $element);
15 $values{$key} = $value;
18 open FILE
, $values{'path'} || die("Could not open file\n");
19 seek FILE
, $values{'start'}, 0;
20 read FILE
, $expectedData, $values{'length'};
23 if ($postData eq $expectedData) {
29 print "Wrong method: " . $ENV{'REQUEST_METHOD'} . "\n";