my $filehandle = upload('datafile'); open (FILE,">$serverFile") or die $!; binmode FILE; binmode $filehandle; while (my $bytesread=read($filehandle,$buffer,1024)) { print FILE $buffer; } close (FILE);