open(FILE1, ">$file") or die "uploaden not working"; binmode FILE1; while (my $bytesread = read($file1, my $buffer, 1024)) { print FILE1 $buffer; }