my $fn = (exists $ENV{'HTTP_X_FILENAME'} ? $ENV{'HTTP_X_FILENAME'} : "" ); my $rep = (exists $ENV{'HTTP_X_REP'} ? $ENV{'HTTP_X_REP'} : "" ); print "Content-type: text/html; charset=utf-8\r\n\r\n" ; my $repTmp = "/tmp/" ; my $fichier = "$repTmp/$fn" ; my $len = 0 ; if( open ( UPLOADFILE, ">$fichier" ) ) { binmode UPLOADFILE; while( ) { print UPLOADFILE $_ ; $len += length($_); } close UPLOADFILE ; } # an internal function to verify the file and to move it fais_copy($repTmp , $fn,$rep,1,0); print "ok $rep$fn de $len octets\n" ;