#!/usr/bin/perl # Dateien empfangen und serverseitig speichern use strict; use warnings; use IO::File; use File::Copy; chdir "/tmp"; # Request-Header x-upload: filename if( my $filename = $ENV{HTTP_X_UPLOAD} ){ my $fh = IO::File->new; $fh->open("/tmp/$filename", O_CREAT|O_BINARY|O_TRUNC|O_RDWR) or die $!; copy *STDIN, $fh; my $size = -s $fh; $fh->close; print "Content-Length: 0\n", "Content-Type: text/plain\n\n", "$filename==$size\n\n"; # Letzteres wird aus der Response geparst zu einem Hash } else{ print "Content-Length: 0\n", "Content-Type: text/plain\n\n", "Done"; }