sub check_filesize { # Check if upload file size is approximately equal to the file written my ($up_file, $down_file)=@_; return (abs ( int($up_file/1024) - int($down_file/1024) ) <= 1); }