# Now upload the file $inpfsz = 0; open(RESFIL, '>', $resfnm); binmode(RESFIL); while ($inpcnt=read($mntfnm,$inpbuf,2096)) { $inpfsz += $inpcnt; print RESFIL $inpbuf; } close(RESFIL);